-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add Counter-example component for test rtk, add test
- Loading branch information
Showing
21 changed files
with
405 additions
and
27 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/apps/SiteApp/configs/redux-tollkit/site-app.rtk-store-config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { configureStore } from '@reduxjs/toolkit'; | ||
import { | ||
SiteAppRtkStoreSchema, | ||
} from '@/apps/SiteApp/configs/redux-tollkit/site-app.rtk-store-schema.ts'; | ||
import { | ||
counterReducer, | ||
} from '@/components/entities/Counter/model/slice/counterSlice.ts'; | ||
|
||
|
||
export const createSiteAppReduxStore = function (initialState?: SiteAppRtkStoreSchema) { | ||
return configureStore<SiteAppRtkStoreSchema>({ | ||
reducer : { | ||
counter: counterReducer, | ||
}, | ||
devTools : __IS_DEV__, | ||
preloadedState: initialState, | ||
}); | ||
}; |
8 changes: 8 additions & 0 deletions
8
src/apps/SiteApp/configs/redux-tollkit/site-app.rtk-store-schema.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { | ||
CounterSchema, | ||
} from '@/components/entities/Counter/model/types/counterSchema.ts'; | ||
|
||
|
||
export interface SiteAppRtkStoreSchema { | ||
counter: CounterSchema; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/apps/SiteApp/providers/SiteAppReduxToolkitProvider.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from 'react'; | ||
import { Provider } from 'react-redux'; | ||
import { | ||
createSiteAppReduxStore, | ||
} from '@/apps/SiteApp/configs/redux-tollkit/site-app.rtk-store-config.ts'; | ||
|
||
|
||
export type SiteAppReduxToolkitProviderProps = { | ||
children: React.ReactNode; | ||
}; | ||
|
||
const SiteAppReduxToolkitProvider: React.FC<SiteAppReduxToolkitProviderProps> = (props) => { | ||
const { children } = props; | ||
const store = createSiteAppReduxStore(); | ||
|
||
return ( | ||
<Provider store={ store }> | ||
{ children } | ||
</Provider> | ||
); | ||
}; | ||
|
||
export default React.memo(SiteAppReduxToolkitProvider); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.container { | ||
display : flex; | ||
flex-direction : column; | ||
gap : var(--offset-medium); | ||
align-items : center; | ||
|
||
.buttons { | ||
display : flex; | ||
gap : var(--offset-medium); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import CounterSimpleTestIt | ||
from '@/components/entities/Counter/__its__/Counter.simple-test.it.tsx'; | ||
|
||
|
||
describe('Counter', () => { | ||
it('Simple-test', CounterSimpleTestIt); | ||
}); |
Oops, something went wrong.