From 1c66d2728cd56c89a440df06f57a9f700ab42a53 Mon Sep 17 00:00:00 2001 From: ilkin-overleaf <100852799+ilkin-overleaf@users.noreply.github.com> Date: Thu, 31 Aug 2023 13:33:49 +0300 Subject: [PATCH] Merge pull request #14405 from overleaf/ii-enable-tests [web] Enable disabled tests GitOrigin-RevId: 1b7199446849ccaf3febe51409f73d9305a93e9c --- .../editor-left-menu.spec.tsx | 20 +++++++++++-------- .../pdf-preview/pdf-preview.spec.tsx | 11 +++++----- .../history/components/change-list.spec.tsx | 3 +-- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/services/web/test/frontend/components/editor-left-menu/editor-left-menu.spec.tsx b/services/web/test/frontend/components/editor-left-menu/editor-left-menu.spec.tsx index 58fedc5d97..56928a1080 100644 --- a/services/web/test/frontend/components/editor-left-menu/editor-left-menu.spec.tsx +++ b/services/web/test/frontend/components/editor-left-menu/editor-left-menu.spec.tsx @@ -14,8 +14,7 @@ describe('', function () { cy.interceptCompile() }) - // eslint-disable-next-line mocha/no-skipped-tests - describe.skip('for non-anonymous users', function () { + describe('for non-anonymous users', function () { const overallThemes: OverallThemeMeta[] = [ { name: 'Overall Theme 1', @@ -179,7 +178,7 @@ describe('', function () { mathDisplay: 1, errors: 0, }, - }) + }).as('wordCount') const scope = mockScope({ ui: { @@ -194,6 +193,8 @@ describe('', function () { ) cy.findByRole('button', { name: 'Word Count' }).click() + + cy.wait('@wordCount') cy.findByText('Total Words:') cy.findByText('781') cy.findByText('Headers:') @@ -260,11 +261,11 @@ describe('', function () { cy.intercept('GET', '/user/github-sync/status', { available: false, enabled: false, - }) + }).as('user-status') cy.intercept('GET', '/project/*/github-sync/status', { enabled: false, - }) + }).as('project-status') const scope = mockScope({ ui: { @@ -278,8 +279,11 @@ describe('', function () { ) + cy.wait('@compile') cy.findByRole('button', { name: 'GitHub' }).click() cy.findByText('GitHub Sync') + + cy.wait(['@user-status', '@project-status']) cy.findByText('Push to GitHub, pull to Overleaf') }) }) @@ -562,9 +566,9 @@ describe('', function () { 'editortheme-2', 'editortheme-3', '—————————————————', - 'legacytheme-1', - 'legacytheme-2', - 'legacytheme-3', + 'legacytheme-1 (Legacy)', + 'legacytheme-2 (Legacy)', + 'legacytheme-3 (Legacy)', ]) } ) diff --git a/services/web/test/frontend/components/pdf-preview/pdf-preview.spec.tsx b/services/web/test/frontend/components/pdf-preview/pdf-preview.spec.tsx index dce4f18b32..dee093459d 100644 --- a/services/web/test/frontend/components/pdf-preview/pdf-preview.spec.tsx +++ b/services/web/test/frontend/components/pdf-preview/pdf-preview.spec.tsx @@ -95,8 +95,7 @@ describe('', function () { cy.contains('Your Paper') }) - // eslint-disable-next-line mocha/no-skipped-tests - it.skip('does not compile while compiling', function () { + it('does not compile while compiling', function () { let counter = 0 cy.interceptDeferredCompile(() => counter++).then( resolveDeferredCompile => { @@ -123,10 +122,10 @@ describe('', function () { resolveDeferredCompile() // wait for the original compile to finish - cy.waitForCompile({ pdf: true }) - - // NOTE: difficult to assert that a second request won't be sent, at some point - expect(counter).to.equal(1) + cy.waitForCompile().then(() => { + // NOTE: difficult to assert that a second request won't be sent, at some point + expect(counter).to.equal(1) + }) }) } ) diff --git a/services/web/test/frontend/features/history/components/change-list.spec.tsx b/services/web/test/frontend/features/history/components/change-list.spec.tsx index aa2981a045..069bc642fb 100644 --- a/services/web/test/frontend/features/history/components/change-list.spec.tsx +++ b/services/web/test/frontend/features/history/components/change-list.spec.tsx @@ -433,7 +433,6 @@ describe('change list', function () { }).click() }) }) - cy.findByRole('dialog').as('modal') cy.intercept('POST', '/project/*/labels', req => { req.reply(200, { id: '64633ee158e9ef7da614c000', @@ -445,7 +444,7 @@ describe('change list', function () { }) }).as('addLabel') const newLabel = 'my new label' - cy.get('@modal').within(() => { + cy.findByRole('dialog').within(() => { cy.findByRole('heading', { name: /add label/i }) cy.findByRole('button', { name: /cancel/i }) cy.findByRole('button', { name: /add label/i }).should('be.disabled')