diff --git a/cypress/e2e/CashFlow.cy.js b/cypress/e2e/CashFlow.cy.js new file mode 100644 index 00000000..b81a2e9e --- /dev/null +++ b/cypress/e2e/CashFlow.cy.js @@ -0,0 +1,30 @@ +import BasicSelect from "../../src/components/CashFlow/BasicSelect"; + + +// it("should have a main container", () => { + // cy.get(".cashflow").should("exist"); + // }); + + +describe('CashFlow', () => { + beforeEach(() => { + cy.intercept("POST", "http://localhost:3000/graphql", { + statusCode: 401, + fixture: "data" + }); + cy.visit("http://localhost:3003"); + }) + // Visit the page or component containing the CashFlow component + }); + + it('renders the CashFlow component with correct elements', () => { + // Check if the CashFlow component is rendered + cy.get('.cashflow').should('exist'); + + // Check if the header elements are rendered + cy.get('.cashflow-header').should('exist'); + cy.get('.cashflow-h1').should('exist').and('have.text', 'Cash Flow'); + cy.get('.cashflow-header-income').should('have.length', 2); // Check for two income headers + cy.get('.cashflow-header-text').should('have.length', 2); // Check for two header texts + cy.get('.cashflow-header-income img').should('have.length', 2); // Check for two income header images + }); diff --git a/src/components/CashFlow/CashFlow.css b/src/components/CashFlow/CashFlow.css index 2d4b999d..1b96efa9 100644 --- a/src/components/CashFlow/CashFlow.css +++ b/src/components/CashFlow/CashFlow.css @@ -40,7 +40,7 @@ .cashflow-header-button-container { display: flex; - border: none.; + border: none; padding: 6px 10px; flex-direction: column; justify-content: center; diff --git a/src/components/apollo-client/apollo-client.js b/src/components/apollo-client/apollo-client.js index f0d37fb2..84c2d712 100644 --- a/src/components/apollo-client/apollo-client.js +++ b/src/components/apollo-client/apollo-client.js @@ -2,8 +2,8 @@ import { ApolloClient, InMemoryCache, createHttpLink } from "@apollo/client"; import { setContext } from "@apollo/client/link/context"; const httpLink = createHttpLink({ - uri: "https://doughfin-be.onrender.com/graphql", - // uri: "http://localhost:3000/graphql" + // uri: "https://doughfin-be.onrender.com/graphql", + uri: "http://localhost:3000/graphql" }); const customHeaders = setContext((_, { headers }) => {