test: uncomment project preview test

This commit is contained in:
Oliver Eyton-Williams
2021-10-22 11:25:11 +02:00
committed by moT01
parent 56f219326d
commit d56e0168fa

View File

@ -20,21 +20,20 @@ const legacyFirstChallengeUrls = [
describe('project preview', () => { describe('project preview', () => {
if (Cypress.env('SHOW_UPCOMING_CHANGES') === 'true') { if (Cypress.env('SHOW_UPCOMING_CHANGES') === 'true') {
// it('should appear on the first challenges of each practice project', () => { it('should appear on the first challenges of each practice project', () => {
// practiceProjectUrls.forEach(url => { practiceProjectUrls.forEach(url => {
// cy.visit(url + 'part-1'); cy.visit(url + 'part-1');
// cy.contains('Complete project demo.'); cy.contains('Complete project demo.');
// cy.get('[data-cy="project-preview-modal"]').should('be.focused'); cy.get('[data-cy="project-preview-modal"]').should('be.focused');
// }); });
// }); });
// Tests for the absence of an element are tricky, if, as the case here, the // Tests for the absence of an element are tricky, if, as is the case here,
// element is not rendered initially. So, instead, we test for a side effect // the element is not rendered straight away. So, instead, we test for a
// of not showing the modal: an editor is allowed to get focus. // side effect of not showing the modal: an editor is allowed to get focus.
it('should NOT appear on the second challenges of each practice project', () => { it('should NOT appear on the second challenges of each practice project', () => {
practiceProjectUrls.forEach(url => { practiceProjectUrls.forEach(url => {
cy.visit(url + 'part-2'); cy.visit(url + 'part-2');
// if no modals are showing, then the editor should have focus:
cy.focused() cy.focused()
.parents() .parents()
.should('have.class', 'react-monaco-editor-container'); .should('have.class', 'react-monaco-editor-container');