Merge pull request #14405 from overleaf/ii-enable-tests

[web] Enable disabled tests

GitOrigin-RevId: 1b7199446849ccaf3febe51409f73d9305a93e9c
This commit is contained in:
ilkin-overleaf 2023-08-31 13:33:49 +03:00 committed by Copybot
parent 0c767f67c9
commit 1c66d2728c
3 changed files with 18 additions and 16 deletions

View file

@ -14,8 +14,7 @@ describe('<EditorLeftMenu />', function () {
cy.interceptCompile() cy.interceptCompile()
}) })
// eslint-disable-next-line mocha/no-skipped-tests describe('for non-anonymous users', function () {
describe.skip('for non-anonymous users', function () {
const overallThemes: OverallThemeMeta[] = [ const overallThemes: OverallThemeMeta[] = [
{ {
name: 'Overall Theme 1', name: 'Overall Theme 1',
@ -179,7 +178,7 @@ describe('<EditorLeftMenu />', function () {
mathDisplay: 1, mathDisplay: 1,
errors: 0, errors: 0,
}, },
}) }).as('wordCount')
const scope = mockScope({ const scope = mockScope({
ui: { ui: {
@ -194,6 +193,8 @@ describe('<EditorLeftMenu />', function () {
) )
cy.findByRole('button', { name: 'Word Count' }).click() cy.findByRole('button', { name: 'Word Count' }).click()
cy.wait('@wordCount')
cy.findByText('Total Words:') cy.findByText('Total Words:')
cy.findByText('781') cy.findByText('781')
cy.findByText('Headers:') cy.findByText('Headers:')
@ -260,11 +261,11 @@ describe('<EditorLeftMenu />', function () {
cy.intercept('GET', '/user/github-sync/status', { cy.intercept('GET', '/user/github-sync/status', {
available: false, available: false,
enabled: false, enabled: false,
}) }).as('user-status')
cy.intercept('GET', '/project/*/github-sync/status', { cy.intercept('GET', '/project/*/github-sync/status', {
enabled: false, enabled: false,
}) }).as('project-status')
const scope = mockScope({ const scope = mockScope({
ui: { ui: {
@ -278,8 +279,11 @@ describe('<EditorLeftMenu />', function () {
</EditorProviders> </EditorProviders>
) )
cy.wait('@compile')
cy.findByRole('button', { name: 'GitHub' }).click() cy.findByRole('button', { name: 'GitHub' }).click()
cy.findByText('GitHub Sync') cy.findByText('GitHub Sync')
cy.wait(['@user-status', '@project-status'])
cy.findByText('Push to GitHub, pull to Overleaf') cy.findByText('Push to GitHub, pull to Overleaf')
}) })
}) })
@ -562,9 +566,9 @@ describe('<EditorLeftMenu />', function () {
'editortheme-2', 'editortheme-2',
'editortheme-3', 'editortheme-3',
'—————————————————', '—————————————————',
'legacytheme-1', 'legacytheme-1 (Legacy)',
'legacytheme-2', 'legacytheme-2 (Legacy)',
'legacytheme-3', 'legacytheme-3 (Legacy)',
]) ])
} }
) )

View file

@ -95,8 +95,7 @@ describe('<PdfPreview/>', function () {
cy.contains('Your Paper') cy.contains('Your Paper')
}) })
// eslint-disable-next-line mocha/no-skipped-tests it('does not compile while compiling', function () {
it.skip('does not compile while compiling', function () {
let counter = 0 let counter = 0
cy.interceptDeferredCompile(() => counter++).then( cy.interceptDeferredCompile(() => counter++).then(
resolveDeferredCompile => { resolveDeferredCompile => {
@ -123,10 +122,10 @@ describe('<PdfPreview/>', function () {
resolveDeferredCompile() resolveDeferredCompile()
// wait for the original compile to finish // wait for the original compile to finish
cy.waitForCompile({ pdf: true }) cy.waitForCompile().then(() => {
// NOTE: difficult to assert that a second request won't be sent, at some point
// NOTE: difficult to assert that a second request won't be sent, at some point expect(counter).to.equal(1)
expect(counter).to.equal(1) })
}) })
} }
) )

View file

@ -433,7 +433,6 @@ describe('change list', function () {
}).click() }).click()
}) })
}) })
cy.findByRole('dialog').as('modal')
cy.intercept('POST', '/project/*/labels', req => { cy.intercept('POST', '/project/*/labels', req => {
req.reply(200, { req.reply(200, {
id: '64633ee158e9ef7da614c000', id: '64633ee158e9ef7da614c000',
@ -445,7 +444,7 @@ describe('change list', function () {
}) })
}).as('addLabel') }).as('addLabel')
const newLabel = 'my new label' const newLabel = 'my new label'
cy.get('@modal').within(() => { cy.findByRole('dialog').within(() => {
cy.findByRole('heading', { name: /add label/i }) cy.findByRole('heading', { name: /add label/i })
cy.findByRole('button', { name: /cancel/i }) cy.findByRole('button', { name: /cancel/i })
cy.findByRole('button', { name: /add label/i }).should('be.disabled') cy.findByRole('button', { name: /add label/i }).should('be.disabled')