|
|
@@ -27,7 +27,6 @@ describe('<GrammarlyWarning />', function () {
|
|
|
|
|
|
it('shows warning when grammarly is available', async function () {
|
|
|
grammarlyStub.returns(true)
|
|
|
- window.metaAttributesCache.set('ol-showNewSourceEditorOption', true)
|
|
|
|
|
|
renderWithEditorContext(<GrammarlyWarning delay={100} />, {
|
|
|
scope: {
|
|
|
@@ -46,7 +45,6 @@ describe('<GrammarlyWarning />', function () {
|
|
|
|
|
|
it('does not show warning when grammarly is not available', async function () {
|
|
|
grammarlyStub.returns(false)
|
|
|
- window.metaAttributesCache.set('ol-showNewSourceEditorOption', true)
|
|
|
|
|
|
renderWithEditorContext(<GrammarlyWarning delay={100} />, {
|
|
|
scope: {
|
|
|
@@ -68,7 +66,6 @@ describe('<GrammarlyWarning />', function () {
|
|
|
it('does not show warning when user has dismissed the warning', async function () {
|
|
|
grammarlyStub.returns(true)
|
|
|
localStorage.setItem('editor.has_dismissed_grammarly_warning', true)
|
|
|
- window.metaAttributesCache.set('ol-showNewSourceEditorOption', true)
|
|
|
|
|
|
renderWithEditorContext(<GrammarlyWarning delay={100} />, {
|
|
|
scope: {
|
|
|
@@ -87,24 +84,8 @@ describe('<GrammarlyWarning />', function () {
|
|
|
})
|
|
|
})
|
|
|
|
|
|
- it('does not show warning when user does not have CM6', async function () {
|
|
|
- grammarlyStub.returns(true)
|
|
|
- window.metaAttributesCache.set('ol-showNewSourceEditorOption', false)
|
|
|
-
|
|
|
- renderWithEditorContext(<GrammarlyWarning delay={100} />)
|
|
|
-
|
|
|
- await waitFor(() => {
|
|
|
- expect(
|
|
|
- screen.queryByText(
|
|
|
- 'A browser extension, for example Grammarly, may be slowing down Overleaf.'
|
|
|
- )
|
|
|
- ).to.not.exist
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
it('does not show warning when user have ace as their preference', async function () {
|
|
|
grammarlyStub.returns(true)
|
|
|
- window.metaAttributesCache.set('ol-showNewSourceEditorOption', true)
|
|
|
|
|
|
renderWithEditorContext(<GrammarlyWarning delay={100} />, {
|
|
|
scope: {
|
|
|
@@ -125,7 +106,6 @@ describe('<GrammarlyWarning />', function () {
|
|
|
|
|
|
it('does not show warning when user have rich text as their preference', async function () {
|
|
|
grammarlyStub.returns(true)
|
|
|
- window.metaAttributesCache.set('ol-showNewSourceEditorOption', true)
|
|
|
|
|
|
renderWithEditorContext(<GrammarlyWarning delay={100} />, {
|
|
|
scope: {
|
|
|
@@ -147,7 +127,6 @@ describe('<GrammarlyWarning />', function () {
|
|
|
|
|
|
it('hides warning if close button is pressed', async function () {
|
|
|
grammarlyStub.returns(true)
|
|
|
- window.metaAttributesCache.set('ol-showNewSourceEditorOption', true)
|
|
|
|
|
|
renderWithEditorContext(<GrammarlyWarning delay={100} />, {
|
|
|
scope: {
|