Skip/improve flaky pdf tests (#13150)

GitOrigin-RevId: a98b145e86f325d1df79bdbcd1825ee5a3ca6def
This commit is contained in:
Alf Eaton
2023-05-25 08:04:49 +00:00
committed by Copybot
parent 6bae8fcdde
commit e0d327a3e8
8 changed files with 39 additions and 32 deletions
@@ -46,12 +46,12 @@ describe('useDetachAction', function () {
cy.spy(detachChannel, 'postMessage').as('postDetachMessage')
cy.get('#trigger').click()
cy.get('@postDetachMessage').should('be.calledWith', {
cy.get('@postDetachMessage').should('have.been.calledWith', {
role: 'detacher',
event: 'action-some-action',
data: { args: ['foo'] },
})
cy.get('@actionFunction').should('not.be.called')
cy.get('@actionFunction').should('not.have.been.called')
})
it('call function as non-sender', function () {
@@ -67,8 +67,8 @@ describe('useDetachAction', function () {
cy.spy(detachChannel, 'postMessage').as('postDetachMessage')
cy.get('#trigger').click()
cy.get('@postDetachMessage').should('not.be.called')
cy.get('@actionFunction').should('be.calledWith', 'foo')
cy.get('@postDetachMessage').should('not.have.been.called')
cy.get('@actionFunction').should('have.been.calledWith', 'foo')
})
it('receive message and call function as target', function () {
@@ -92,7 +92,7 @@ describe('useDetachAction', function () {
})
})
cy.get('@actionFunction').should('be.calledWith', 'foo')
cy.get('@actionFunction').should('have.been.calledWith', 'foo')
})
it('receive message and does not call function as non-target', function () {
@@ -116,6 +116,6 @@ describe('useDetachAction', function () {
})
})
cy.get('@actionFunction').should('not.be.called')
cy.get('@actionFunction').should('not.have.been.called')
})
})
@@ -62,7 +62,7 @@ describe('useDetachLayout', function () {
// 2. detach
cy.get('#detach').click()
cy.get('@openWindow').should(
'be.calledOnceWith',
'have.been.calledOnceWith',
Cypress.sinon.match(/\/detached$/),
'_blank'
)
@@ -71,7 +71,8 @@ describe('useDetachLayout', function () {
cy.get('#role').should('have.text', 'detacher')
})
it('detacher role', function () {
// eslint-disable-next-line mocha/no-skipped-tests
it.skip('detacher role', function () {
// 1. create hook in detacher mode
window.metaAttributesCache.set('ol-detachRole', 'detacher')
@@ -95,7 +96,7 @@ describe('useDetachLayout', function () {
})
// 2. simulate connected detached tab
cy.get('@postDetachMessage').should('be.calledWith', {
cy.get('@postDetachMessage').should('have.been.calledWith', {
role: 'detacher',
event: 'up',
})
@@ -134,13 +135,14 @@ describe('useDetachLayout', function () {
cy.get('#isLinked').should('not.be.checked')
cy.get('#isLinking').should('not.be.checked')
cy.get('#role').should('have.text', 'none')
cy.get('@postDetachMessage').should('be.calledWith', {
cy.get('@postDetachMessage').should('have.been.calledWith', {
role: 'detacher',
event: 'reattach',
})
})
it('reset detacher role when other detacher tab connects', function () {
// eslint-disable-next-line mocha/no-skipped-tests
it.skip('reset detacher role when other detacher tab connects', function () {
// 1. create hook in detacher mode
window.metaAttributesCache.set('ol-detachRole', 'detacher')
@@ -225,7 +227,7 @@ describe('useDetachLayout', function () {
cy.get('#isLinked').should('be.checked')
cy.get('#isLinking').should('not.be.checked')
cy.get('#role').should('have.text', 'detached')
cy.get('@postDetachMessage').should('be.calledWith', {
cy.get('@postDetachMessage').should('have.been.calledWith', {
role: 'detached',
event: 'up',
})
@@ -241,6 +243,6 @@ describe('useDetachLayout', function () {
cy.get('#isLinked').should('not.be.checked')
cy.get('#isLinking').should('not.be.checked')
cy.get('#role').should('have.text', 'detached')
cy.get('@closeWindow').should('be.called')
cy.get('@closeWindow').should('have.been.called')
})
})
@@ -73,7 +73,7 @@ describe('useDetachState', function () {
cy.spy(detachChannel, 'postMessage').as('postDetachMessage')
cy.get('#setValue').click()
cy.get('@postDetachMessage').should('be.calledWith', {
cy.get('@postDetachMessage').should('have.been.calledWith', {
role: 'detacher',
event: 'state-some-key',
data: { value: 'barbaz1' },