Skip to content
Snippets Groups Projects
Commit b667c2d0 authored by Muhammad Usama's avatar Muhammad Usama
Browse files

Task-2

parent f6b782fb
No related branches found
No related tags found
No related merge requests found
{
"name": "@unlsoft/minimal-app",
"name": "myapp",
"version": "1.0.0",
"description": "A minimal app to be used as starter code for labs and homework.",
"description": "Working On myapp.",
"private": true,
"license": "UNLICENSED",
"scripts": {
......
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`the app has one labeled button that displays the value from the store 1`] = `
<div>
<label>
Taps
:
<button
class="blue"
>
9999
</button>
</label>
</div>
`;
exports[`the app has one labeled button that displays the value from the store 1`] = `<div />`;
import { Routes, Route } from 'react-router-dom';
import { Counter } from './features/counter/counter.js';
// import { Counter } from './features/counter/counter.js';
export function App() {
const page =
<>
<Counter label={'Taps'} />
{/* <Counter label={'Taps'} /> */}
</>;
return (
<Routes>
......
......@@ -4,16 +4,16 @@ import { MemoryRouter as Router } from 'react-router-dom';
import { App } from './app.js';
import {
selectValue,
} from './features/counter/counterSlice.js';
jest.mock('./features/counter/counterSlice.js', () => ({
selectValue: jest.fn().mockName('selectValue'),
}));
// import {
// selectValue,
// } from './features/counter/counterSlice.js';
// jest.mock('./features/counter/counterSlice.js', () => ({
// selectValue: jest.fn().mockName('selectValue'),
// }));
describe('the app', () => {
test('has one labeled button that displays the value from the store', () => {
selectValue.mockReturnValue(9999);
// selectValue.mockReturnValue(9999);
const { container } = render(
<Router initialEntries={['/']}>
<App />
......
import { configureStore } from '@reduxjs/toolkit';
import counterSlice from '../features/counter/counterSlice.js';
// import counterSlice from '../features/counter/counterSlice.js';
export const store = configureStore({
reducer: {
[counterSlice.name]: counterSlice.reducer,
// [counterSlice.name]: counterSlice.reducer,
},
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment