From b667c2d046109f5400f1b807b587d82687f52237 Mon Sep 17 00:00:00 2001 From: Muhammad Usama <musama2@unl.edu> Date: Thu, 5 Sep 2024 16:10:57 -0500 Subject: [PATCH] Task-2 --- minimal-app/package.json | 4 ++-- minimal-app/src/__snapshots__/app.test.js.snap | 14 +------------- minimal-app/src/app.js | 4 ++-- minimal-app/src/app.test.js | 14 +++++++------- minimal-app/src/app/store.js | 4 ++-- 5 files changed, 14 insertions(+), 26 deletions(-) diff --git a/minimal-app/package.json b/minimal-app/package.json index e726731..b20a0e9 100644 --- a/minimal-app/package.json +++ b/minimal-app/package.json @@ -1,7 +1,7 @@ { - "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": { diff --git a/minimal-app/src/__snapshots__/app.test.js.snap b/minimal-app/src/__snapshots__/app.test.js.snap index ce50593..6c4af2a 100644 --- a/minimal-app/src/__snapshots__/app.test.js.snap +++ b/minimal-app/src/__snapshots__/app.test.js.snap @@ -1,15 +1,3 @@ // 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 />`; diff --git a/minimal-app/src/app.js b/minimal-app/src/app.js index e875b5f..6cdd6f5 100644 --- a/minimal-app/src/app.js +++ b/minimal-app/src/app.js @@ -1,11 +1,11 @@ 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> diff --git a/minimal-app/src/app.test.js b/minimal-app/src/app.test.js index cea18d8..bb8f5c0 100644 --- a/minimal-app/src/app.test.js +++ b/minimal-app/src/app.test.js @@ -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 /> diff --git a/minimal-app/src/app/store.js b/minimal-app/src/app/store.js index ff522e1..94e9e8e 100644 --- a/minimal-app/src/app/store.js +++ b/minimal-app/src/app/store.js @@ -1,9 +1,9 @@ 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, }, }); -- GitLab