From 5ad8438286fde00d4f4ed0b818fe32b43021847f Mon Sep 17 00:00:00 2001 From: Oluwatobi Bamidele Date: Tue, 1 Oct 2024 22:12:31 +0100 Subject: [PATCH] fix: delete unused tests --- cypress/e2e/addNode/addNode.cy.ts | 118 ------------------ cypress/e2e/graph/const.ts | 4 - cypress/e2e/graph/initialRender.cy.ts | 15 --- cypress/e2e/graph/searchAndRender.cy.ts | 32 ----- cypress/e2e/sanity.cy.ts | 6 - cypress/e2e/sentimentChart/const.ts | 7 -- .../sentimentChart/sentimentAnalysis.cy.ts | 48 ------- .../e2e/sentimentChart/sentimentChart.cy.ts | 32 ----- 8 files changed, 262 deletions(-) delete mode 100644 cypress/e2e/addNode/addNode.cy.ts delete mode 100644 cypress/e2e/graph/const.ts delete mode 100644 cypress/e2e/graph/initialRender.cy.ts delete mode 100644 cypress/e2e/graph/searchAndRender.cy.ts delete mode 100644 cypress/e2e/sanity.cy.ts delete mode 100644 cypress/e2e/sentimentChart/const.ts delete mode 100644 cypress/e2e/sentimentChart/sentimentAnalysis.cy.ts delete mode 100644 cypress/e2e/sentimentChart/sentimentChart.cy.ts diff --git a/cypress/e2e/addNode/addNode.cy.ts b/cypress/e2e/addNode/addNode.cy.ts deleted file mode 100644 index 86cb7a45f..000000000 --- a/cypress/e2e/addNode/addNode.cy.ts +++ /dev/null @@ -1,118 +0,0 @@ -import { actionMenu, addNodeModal, addNodeSubmitButton, host, toast } from '../../support' -import { addContentMenu, checkbox, description, endTime, link, select, startTime, tagError, tags } from './const' - -describe('Add Node Form / Home interactions', () => { - /*beforeEach(() => { - cy.visit('/') - }) - - const modal = () => cy.get(addNodeModal) - const submitButton = () => cy.get(addNodeSubmitButton) - const tagErrorMessage = () => cy.get(tagError) - const linkInput = () => cy.get(link) - const startTimeInput = () => cy.get(startTime) - const endTimeInput = () => cy.get(endTime) - const descriptionInput = () => cy.get(description) - const tagsInput = () => cy.get(tags) - const toastBody = () => cy.get(toast) - const checkboxButton = () => cy.get(checkbox) - - it('submitting the form with all fields empty yields 5 error messages', () => { - cy.get(actionMenu).click({ waitForAnimations: false }) - cy.get(addContentMenu).click({ waitForAnimations: false }) - - cy.get(select).click({ waitForAnimations: false }) - - cy.get('span.react-dropdown-select-item').eq(0).click({ waitForAnimations: false }) - - checkboxButton().click({ waitForAnimations: false }) - - submitButton().click({ waitForAnimations: false }) - - cy.contains(/the field is required/i).should('be.visible') - - tagErrorMessage() - .should('be.visible') - .and('contain.text', 'You need to enter at least 1 topic tag to submit a node.') - }) - - it('all fields filled out correctly submits the form and checkbox checked, closes the modal and displays custom success message', () => { - cy.intercept( - { - hostname: host, - method: 'POST', - url: '/add_node', - }, - { - body: { - success: true, - }, - statusCode: 200, - }, - ).as('add_node') - - cy.get(actionMenu).click({ waitForAnimations: false }) - cy.get(addContentMenu).click({ waitForAnimations: false }) - - cy.get(select).click({ waitForAnimations: false }) - - cy.get('span.react-dropdown-select-item').eq(0).click({ waitForAnimations: false }) - - checkboxButton().click({ waitForAnimations: false }) - - linkInput().type('youtube.com/watch?v=Midgx8bBDMk', { - waitForAnimations: false, - }) - - startTimeInput().type('000000') - endTimeInput().type('000030') - descriptionInput().type('description') - tagsInput().type('test').type('{enter}') - - submitButton().click({ waitForAnimations: false }) - - cy.wait('@add_node') - - modal().should('not.exist') - cy.wait(3000) - toastBody().should('be.visible').and('contain.text', 'Submitted!') - }) - - it('checkbox checked, submitting the form but receiving an error response from the server, displays custom error message', () => { - cy.intercept( - { - hostname: host, - method: 'POST', - url: '/add_node', - }, - { - body: { error: { message: 'Payment required' } }, - statusCode: 402, - }, - ).as('add_node') - - cy.get(actionMenu).click({ waitForAnimations: false }) - cy.get(addContentMenu).click({ waitForAnimations: false }) - - cy.get(select).click({ waitForAnimations: false }) - - cy.get('span.react-dropdown-select-item').eq(0).click({ waitForAnimations: false }) - - checkboxButton().click({ waitForAnimations: false }) - - linkInput().type('youtube.com/watch?v=Midgx8bBDMk', { - waitForAnimations: false, - }) - - startTimeInput().type('000000') - endTimeInput().type('000030') - descriptionInput().type('description') - tagsInput().type('test').type('{enter}') - - submitButton().click({ waitForAnimations: false }) - - cy.wait('@add_node') - cy.wait(3000) - toastBody().should('be.visible').and('contain.text', 'Submission failed, please try again.') - })*/ -}) diff --git a/cypress/e2e/graph/const.ts b/cypress/e2e/graph/const.ts deleted file mode 100644 index 9c17f50ca..000000000 --- a/cypress/e2e/graph/const.ts +++ /dev/null @@ -1,4 +0,0 @@ -export const canvas = '#universe-canvas' -export const searchResultList = '#search-result-list' -export const canvasHtmlPanel = '#html-panel' -export const episodeDescription = '[data-testid="episode-description"]' diff --git a/cypress/e2e/graph/initialRender.cy.ts b/cypress/e2e/graph/initialRender.cy.ts deleted file mode 100644 index 1dcfac5b4..000000000 --- a/cypress/e2e/graph/initialRender.cy.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { getScenenChildrens } from '../../support' - -describe('Initial graph render / Home interactions', () => { - /*beforeEach(() => { - cy.visit('/') - }) - - it('The graph is rendered', () => { - getScenenChildrens().should('exist') - - getScenenChildrens().then((children) => { - expect(children).to.be.length - }) - })*/ -}) diff --git a/cypress/e2e/graph/searchAndRender.cy.ts b/cypress/e2e/graph/searchAndRender.cy.ts deleted file mode 100644 index b63d42726..000000000 --- a/cypress/e2e/graph/searchAndRender.cy.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { budgetModal, getScenenChildrens, host, loader, search } from '../../support' -import { searchResultList } from './const' - -describe('Search and render / Home interactions', () => { - /*beforeEach(() => { - cy.visit('/') - - cy.wait(5000) - }) - - it('Search and render the Graph', () => { - cy.intercept( - { - hostname: host, - method: 'GET', - url: '/searching*', - }, - { - fixture: 'search.json', - delay: 1000, - }, - ).as('search') - - cy.get(search).should('exist').type('bitcoin {enter}') - cy.get(budgetModal).should('exist').find('button').click() - cy.get(loader).should('exist') - cy.wait('@search') - - getScenenChildrens().should('exist') - cy.get(searchResultList).should('exist') - })*/ -}) diff --git a/cypress/e2e/sanity.cy.ts b/cypress/e2e/sanity.cy.ts deleted file mode 100644 index 9a357de38..000000000 --- a/cypress/e2e/sanity.cy.ts +++ /dev/null @@ -1,6 +0,0 @@ -describe('sanity check', () => { - it('should pass', () => { - expect(1 + 2).to.equal(3) - expect(2 + 2).to.not.equal(5) - }) -}) diff --git a/cypress/e2e/sentimentChart/const.ts b/cypress/e2e/sentimentChart/const.ts deleted file mode 100644 index bd5d87084..000000000 --- a/cypress/e2e/sentimentChart/const.ts +++ /dev/null @@ -1,7 +0,0 @@ -export const openChartBtn = '#cy-open-sentiment-data' -export const chartWrapper = '#cy-sentiment-chart-wrapper' -export const sentimentChart = '#cy-sentiment-chart' -export const sentimentTab = '#sentiment' -export const sentimentSlider = '#cy-sentiment-analysis-slider' -export const requestAnalysBtn = '#cy-get-sentiment-analysis-btn' -export const requestSentimentsBtn = '#cy-get-sentiments-btn' diff --git a/cypress/e2e/sentimentChart/sentimentAnalysis.cy.ts b/cypress/e2e/sentimentChart/sentimentAnalysis.cy.ts deleted file mode 100644 index 831994735..000000000 --- a/cypress/e2e/sentimentChart/sentimentAnalysis.cy.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { budgetModal, helperActionsMenu, host, search, siriBtn } from '../../support' -import { requestAnalysBtn, sentimentChart } from './const' - -describe('Search and render / Home interactions', () => { - /*beforeEach(() => { - cy.visit('/') - cy.wait(5000) - }) - - it('Search and render the Graph', () => { - cy.intercept( - { - hostname: host, - method: 'GET', - url: '/searching*', - }, - { - fixture: 'search.json', - }, - ).as('search') - - cy.intercept( - { - hostname: host, - method: 'GET', - url: '/sentiments*', - }, - { - fixture: 'sentiments.json', - }, - ).as('sentiments') - - cy.get(search).should('exist').type('bitcoin {enter}') - cy.get(budgetModal).should('exist').find('button').click() - cy.wait('@search') - - cy.get(siriBtn).click({ force: true }) - - cy.get(helperActionsMenu) - .contains(/sentimen/gi) - .click() - - cy.get(requestAnalysBtn).click() - - cy.wait('@sentiments') - cy.get(sentimentChart).should('exist') - })*/ -}) diff --git a/cypress/e2e/sentimentChart/sentimentChart.cy.ts b/cypress/e2e/sentimentChart/sentimentChart.cy.ts deleted file mode 100644 index 288d5f8b2..000000000 --- a/cypress/e2e/sentimentChart/sentimentChart.cy.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { actionMenu, closeSidebar, host } from '../../support' -import { chartWrapper, openChartBtn, requestSentimentsBtn } from './const' - -describe('Sentiment chart / Home interactions', () => { - /*beforeEach(() => { - cy.visit('/') - }) - - it('Chart is rendered', () => { - cy.intercept( - { - hostname: host, - method: 'GET', - url: '/sentiments', - }, - { - fixture: 'sentiments.json', - }, - ).as('sentiments') - - cy.get(actionMenu).click({ waitForAnimations: false }) - cy.get(openChartBtn).click({ waitForAnimations: false }) - cy.get(requestSentimentsBtn).click({ waitForAnimations: false }) - - cy.wait('@sentiments') - - cy.get(chartWrapper).contains(/Sentiment chart/i) - cy.get(chartWrapper).find('svg').should('exist') - cy.get(closeSidebar).click() - cy.get(chartWrapper).should('not.exist') - })*/ -})