Skip to content

Commit

Permalink
feat: change duplicate type
Browse files Browse the repository at this point in the history
  • Loading branch information
Piccio98 committed May 11, 2023
1 parent 82d0c0a commit 748bead
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -212,7 +212,7 @@ export interface EditCard {
type: string
}

export interface Customers {
export interface VendorCustomers {
organization: Organization
}

Expand Down
40 changes: 40 additions & 0 deletions test/Vendor/VendorRoutes.test.tsx
Original file line number Diff line number Diff line change
@@ -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(
<BrowserRouter>
<ConfigProvider>
<Provider store={store}>
<VendorRoutes />
</Provider>
</ConfigProvider>
</BrowserRouter>

);
expect(baseElement).toBeValid()
});

});

0 comments on commit 748bead

Please sign in to comment.