-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4139a3a
commit 59362c2
Showing
5 changed files
with
160 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
test/e2e-test-application/cypress/e2e/tests/0-js-test-app/js-test-app-layout.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import defaultLuigiConfig from '../../configs/default'; | ||
|
||
describe('addBackdrop, removeBackdrop', () => { | ||
let newConfig; | ||
beforeEach(() => { | ||
newConfig = structuredClone(defaultLuigiConfig); | ||
newConfig.tag = 'addBackdrop'; | ||
}); | ||
it('addBackDrop', () => { | ||
let $iframeBody; | ||
cy.visitTestApp('/home/one', newConfig); | ||
cy.get('#app[configversion="addBackdrop"]'); | ||
cy.get('.lui-backdrop').should('not.exist'); | ||
cy.getIframeBody({}, 0, '.iframeContainer').then((result) => { | ||
$iframeBody = result; | ||
cy.wrap($iframeBody).find('.addBackdrop').contains('add backdrop').click(); | ||
}); | ||
cy.get('.lui-backdrop').should('exist'); | ||
cy.get('[data-testid="home_home"]').then(($btn) => { | ||
cy.get('.lui-backdrop').then(($overlay) => { | ||
const btnRect = $btn[0].getBoundingClientRect(); | ||
const overlayRect = $overlay[0].getBoundingClientRect(); | ||
|
||
expect(overlayRect.top).to.be.at.most(btnRect.top); | ||
expect(overlayRect.left).to.be.at.most(btnRect.left); | ||
expect(overlayRect.bottom).to.be.at.least(btnRect.bottom); | ||
expect(overlayRect.right).to.be.at.least(btnRect.right); | ||
}); | ||
}); | ||
|
||
cy.getIframeBody({}, 0, '.iframeContainer').then((result) => { | ||
$iframeBody = result; | ||
cy.wrap($iframeBody).find('.removeBackdrop').contains('remove backdrop').click(); | ||
}); | ||
cy.get('.lui-backdrop').should('not.exist'); | ||
}); | ||
}); |