Skip to content

Commit

Permalink
Merge pull request #23 from DoughFin/feature/df-100-debug-income-dupl…
Browse files Browse the repository at this point in the history
…ication-rendering-error

Change uri in appolo client to use localhost instead of render
  • Loading branch information
chisPmama authored Feb 23, 2024
2 parents 04cb9b2 + cbc1e30 commit f3c335e
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
30 changes: 30 additions & 0 deletions cypress/e2e/CashFlow.cy.js
Original file line number Diff line number Diff line change
@@ -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
});
2 changes: 1 addition & 1 deletion src/components/CashFlow/CashFlow.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

.cashflow-header-button-container {
display: flex;
border: none.;
border: none;
padding: 6px 10px;
flex-direction: column;
justify-content: center;
Expand Down
4 changes: 2 additions & 2 deletions src/components/apollo-client/apollo-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) => {
Expand Down

0 comments on commit f3c335e

Please sign in to comment.