From 748bead34c4a25b87aa10fd8ddf41f3625357ff0 Mon Sep 17 00:00:00 2001 From: Piccio98 <104207695+Piccio98@users.noreply.github.com> Date: Thu, 11 May 2023 17:31:14 +0200 Subject: [PATCH] feat: change duplicate type --- src/types.ts | 4 ++-- test/Vendor/VendorRoutes.test.tsx | 40 +++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 test/Vendor/VendorRoutes.test.tsx diff --git a/src/types.ts b/src/types.ts index 654081b..9036f5c 100644 --- a/src/types.ts +++ b/src/types.ts @@ -123,7 +123,7 @@ export interface Activity { export type TimeStamp = "Weekly" | "Monthly" | "Yearly" | "" export type EnergyType = "Solar" | "Hydro" | "Geo" | "Wind" -export interface Bills { +export interface BillsAggregated { totalElectric: number, totalGas: number, totalWater: number, @@ -212,7 +212,7 @@ export interface EditCard { type: string } -export interface Customers { +export interface VendorCustomers { organization: Organization } diff --git a/test/Vendor/VendorRoutes.test.tsx b/test/Vendor/VendorRoutes.test.tsx new file mode 100644 index 0000000..4bab38e --- /dev/null +++ b/test/Vendor/VendorRoutes.test.tsx @@ -0,0 +1,40 @@ +import VendorRoutes from "../../src/Vendor/VendorRoutes" +import React from 'react'; +import { expect, describe, it, vi } from 'vitest' +import { render } from '@testing-library/react'; +import '@testing-library/jest-dom'; +import { BrowserRouter } from "react-router-dom"; +import { ConfigProvider } from "antd"; +import { Provider } from "react-redux"; +import { store } from "../../src/store"; +import { fetchOrganization } from "../../src/reducers/organization"; + +describe('VendorRoutes', () => { + it('renders the correctly', () => { + + store.dispatch(fetchOrganization({ + _id: "string", + name: "string", + description: "string", + userId: "string", + type: [], + icon: "string", + customers: [], + details: {}, + createAt: "2023-05-10T16:24:51.677Z" + })) + + const { baseElement, getByText } = render( + + + + + + + + + ); + expect(baseElement).toBeValid() + }); + +}); \ No newline at end of file