From 966ef13300d90d9936e6bf4ac01b7831094e4b0a Mon Sep 17 00:00:00 2001 From: Alejandro Lembke Barrientos Date: Wed, 11 Oct 2023 23:35:53 +0000 Subject: [PATCH] PR-722301: Adding ContainerList Tests. --- .../__tests__/ContainerList.test.cy.tsx | 11 +++++++++++ .../__tests__/ContainerList.test.tsx | 18 ++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 src/components/ContainerList/__tests__/ContainerList.test.cy.tsx create mode 100644 src/components/ContainerList/__tests__/ContainerList.test.tsx diff --git a/src/components/ContainerList/__tests__/ContainerList.test.cy.tsx b/src/components/ContainerList/__tests__/ContainerList.test.cy.tsx new file mode 100644 index 0000000..aedd02d --- /dev/null +++ b/src/components/ContainerList/__tests__/ContainerList.test.cy.tsx @@ -0,0 +1,11 @@ +import React from 'react'; +import { ContainerList } from '@components'; + +describe('Testing ContainerList Component', () => { + beforeEach(() => { + cy.mount(); + }); + it('Show Title of Container List', () => { + cy.get('div').contains('Test Title'); + }); +}) diff --git a/src/components/ContainerList/__tests__/ContainerList.test.tsx b/src/components/ContainerList/__tests__/ContainerList.test.tsx new file mode 100644 index 0000000..1f68b11 --- /dev/null +++ b/src/components/ContainerList/__tests__/ContainerList.test.tsx @@ -0,0 +1,18 @@ +import React from 'react'; +import { render, screen } from '@testing-library/react'; +import { ContainerList } from '@components'; + +describe('Testing ContainerList Component', () => { + beforeEach(() => { + // fetchMock.resetMocks(); + render() + }); + it('Show Title of Container List', async () => { + /* fetchMock.mockResponseOnce(JSON.stringify({ + //First Data Fetch + data: 'data' + })); */ + const title = screen.getByText('Test Title'); + expect(title).toBeInTheDocument(); + }) +})