test: fix multifile tests (#46384)

cy.viewport should not be chainable, hence the failure in CI. Also, the
tests need to check for the absence of (Ctrl + Enter), not the presence
Check Your Code since that's present for all viewports.
pull/46387/head
Oliver Eyton-Williams 2022-06-07 19:05:34 +02:00 committed by GitHub
parent ecfac5733c
commit 51bb887a28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 6 deletions

View File

@ -11,16 +11,17 @@ describe('Challenge with multifile editor', () => {
});
it('renders the file tab buttons', () => {
cy.get(selectors.monacoTabs).should('exist');
cy.get(selectors.monacoTabs).contains('index.html');
cy.get(selectors.monacoTabs).contains('styles.css');
});
it('checks for correct text at different widths', () => {
cy.viewport(768, 660)
.get(selectors.testButton)
.contains('Check Your Code (Ctrl + Enter)');
it.only('checks for correct text at different widths', () => {
cy.viewport(768, 660);
cy.get(selectors.testButton).contains('Check Your Code (Ctrl + Enter)');
cy.viewport(767, 660).get(selectors.testButton).contains('Check Your Code');
cy.viewport(767, 660);
cy.get(selectors.testButton)
.should('not.contain.text', '(Ctrl + Enter)')
.contains('Check Your Code');
});
});