Skip to content

Commit c0b9625

Browse files
authored
Merge pull request #56 from oslabs-beta/finalbranchkelvin
updated component test suites to pass given updates to FrontEndTypes file
2 parents 54d0086 + e25839d commit c0b9625

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

src/app/__tests__/ButtonContainer.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ const customInitialState = {
114114
main: {
115115
port: null,
116116
currentTab: 87, // Update with your desired value
117-
currentTitle: 'No Target',
117+
currentTitle: 'test string',
118118
tabs: customTabs, // Replace with the actual (testing) tab data
119119
currentTabInApp: 'test string',
120120
connectionStatus: false,

src/app/__tests__/TravelContainer.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ const customInitialState = {
110110
main: {
111111
port: null,
112112
currentTab: 87, // Update with your desired value
113-
currentTitle: null,
113+
currentTitle: 'test string',
114114
tabs: customTabs, // Replace with the actual (testing) tab data
115115
currentTabInApp: null,
116116
connectionStatus: false,

src/app/__tests__/WebMetrics.test.tsx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -113,38 +113,38 @@ const customInitialState = {
113113
main: {
114114
port: null,
115115
currentTab: 87, // Update with your desired value
116-
currentTitle: null,
116+
currentTitle: 'test string',
117117
tabs: customTabs, // Replace with the actual (testing) tab data
118118
currentTabInApp: null,
119119
connectionStatus: false,
120120
connectRequested: true,
121121
},
122122
};
123123

124+
const props = {
125+
score: [5]
126+
};
127+
124128
const customStore = configureStore({
125-
reducer: {
126-
main: mainSlice.reducer,
129+
reducer: {
130+
main: mainSlice.reducer,
127131
},
128-
preloadedState: customInitialState, // Provide custom initial state
129-
middleware: (getDefaultMiddleware) =>
130-
getDefaultMiddleware({ serializableCheck: false }),
132+
preloadedState: customInitialState, // Provide custom initial state
133+
middleware: (getDefaultMiddleware) =>
134+
getDefaultMiddleware({ serializableCheck: false }),
131135
});
132136

133137
const render = component => rtlRender(
134-
<Provider store={customStore}>
135-
{component}
136-
</Provider>
138+
<Provider store={customStore}>
139+
{component}
140+
</Provider>
137141
);
142+
138143
jest.mock('react-apexcharts', () => ({ __esModule: true, default: () => <div /> }));
139-
// const dispatch = jest.fn();
140-
// jest.spyOn(React, 'useEffect').mockImplementation(() => jest.fn());
141-
// jest.mock('../store');
142-
// const mockedStoreContext = jest.mocked(useStoreContext);
143-
// mockedStoreContext.mockImplementation(() => [, dummyDispatch]);
144144

145145
describe('WebMetrics graph testing', () => {
146146
test('should have 1 div with class name "metric" ', () => {
147-
const { container } = render(<WebMetrics />);
147+
const { container } = render(<WebMetrics {...props}/>);
148148
expect(container.getElementsByClassName('metric').length).toBe(1);
149149
});
150150
});

0 commit comments

Comments
 (0)