From 418ba649d18a769e710c2fa19e509ff756c3421e Mon Sep 17 00:00:00 2001 From: Sem Bauke Date: Mon, 6 May 2024 20:43:25 +0200 Subject: [PATCH] fix: delete already covered project preview test by Playwright (#54676) --- .../learn/challenges/project-preview.ts | 104 ------------------ 1 file changed, 104 deletions(-) delete mode 100644 cypress/e2e/default/learn/challenges/project-preview.ts diff --git a/cypress/e2e/default/learn/challenges/project-preview.ts b/cypress/e2e/default/learn/challenges/project-preview.ts deleted file mode 100644 index 7d40b78fd31..00000000000 --- a/cypress/e2e/default/learn/challenges/project-preview.ts +++ /dev/null @@ -1,104 +0,0 @@ -const practiceProjects = [ - { - title: 'Accessibility Quiz', - url: '/learn/2022/responsive-web-design/learn-accessibility-by-building-a-quiz/' - }, - { - title: 'Cafe Menu', - url: '/learn/2022/responsive-web-design/learn-basic-css-by-building-a-cafe-menu/' - }, - { - title: 'Ferris Wheel', - url: '/learn/2022/responsive-web-design/learn-css-animation-by-building-a-ferris-wheel/' - }, - { - title: 'Colored Markers', - url: '/learn/2022/responsive-web-design/learn-css-colors-by-building-a-set-of-colored-markers/' - }, - { - title: 'Photo Gallery', - url: '/learn/2022/responsive-web-design/learn-css-flexbox-by-building-a-photo-gallery/' - }, - { - title: 'Magazine', - url: '/learn/2022/responsive-web-design/learn-css-grid-by-building-a-magazine/' - }, - { - title: 'Penguin', - url: '/learn/2022/responsive-web-design/learn-css-transforms-by-building-a-penguin/' - }, - { - title: 'City Skyline', - url: '/learn/2022/responsive-web-design/learn-css-variables-by-building-a-city-skyline/' - }, - { - title: 'CatPhotoApp', - url: '/learn/2022/responsive-web-design/learn-html-by-building-a-cat-photo-app/' - }, - { - title: 'Registration Form', - url: '/learn/2022/responsive-web-design/learn-html-forms-by-building-a-registration-form/' - }, - { - title: 'fCC Cat Painting', - url: '/learn/2022/responsive-web-design/learn-intermediate-css-by-building-a-cat-painting/' - }, - { - title: 'Balance Sheet', - url: '/learn/2022/responsive-web-design/learn-more-about-css-pseudo-selectors-by-building-a-balance-sheet/' - }, - { - title: 'Piano', - url: '/learn/2022/responsive-web-design/learn-responsive-web-design-by-building-a-piano/' - }, - { - title: 'Rothko Painting', - url: '/learn/2022/responsive-web-design/learn-the-css-box-model-by-building-a-rothko-painting/' - }, - { - title: 'Nutrition Label', - url: '/learn/2022/responsive-web-design/learn-typography-by-building-a-nutrition-label/' - } -]; - -const legacyFirstChallengeUrls = [ - '/learn/responsive-web-design/basic-html-and-html5/say-hello-to-html-elements', - '/learn/responsive-web-design/basic-css/change-the-color-of-text', - '/learn/responsive-web-design/applied-visual-design/create-visual-balance-using-the-text-align-property', - '/learn/responsive-web-design/applied-accessibility/add-a-text-alternative-to-images-for-visually-impaired-accessibility', - '/learn/responsive-web-design/css-flexbox/use-display-flex-to-position-two-boxes', - '/learn/responsive-web-design/css-grid/create-your-first-css-grid' -]; - -describe('project preview', () => { - it('should appear on the first challenges of each practice project', () => { - practiceProjects.forEach(({ url }) => { - cy.visit(url + 'step-1'); - cy.get('div[role="dialog"]') - .contains("Here's a preview of what you will build") - .should('be.visible'); - }); - }); - - // Tests for the absence of an element are tricky, if, as is the case here, - // the element is not rendered straight away. So, instead, we test for a - // 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', () => { - practiceProjects.forEach(({ url }) => { - cy.visit(url + 'step-2'); - cy.focused() - .parents() - .should('have.class', 'react-monaco-editor-container'); - }); - }); - - it('should NOT appear on the first challenges of legacy blocks', () => { - legacyFirstChallengeUrls.forEach(url => { - cy.visit(url); - // if no modals are showing, then the editor should have focus: - cy.focused() - .parents() - .should('have.class', 'react-monaco-editor-container'); - }); - }); -});