Resolve MIN-57 "Feature/ connect drug search query"
3 unresolved threads
Description
Introduced fetching for drugs query
Things done
- fetching
- saving to redux store under 'drugs'
- initialised integrational testing for redux
- introduced axios mock library
- introduced utility functions for mocking axios
- introduced utility library for zod fixtures
Main idea behind testing:
Atm I see two cases for testing redux store and the logic inside
- testing async calls and thunks to make sure that validation of the data is there
- testing asserting data to the store and manipulating it. Atm it's not complex -> but It will
Pay attention for:
-
missing unit test for rest of the functionsAlready done -
utility function for reseting function store should be moved to abstractionAlready done - store has to be reseted before each test because it's not a mock function -> that's why utility function was created
Edited by Tadeusz Miesiąc
Merge request reports
Activity
Filter activity
assigned to @mateuszmiko
requested review from @AdrianOrlow and @mateuszmiko
unassigned @mateuszmiko
Hey @AdrianOrlow I used parts of your PoC here !4 (closed) take a look.
- Resolved by mateuszmiko
mentioned in merge request !22 (merged)
- Resolved by Tadeusz Miesiąc
- src/constants/mapId.ts 0 → 100644
- src/models/referenceSchema.ts 0 → 100644
1 import { z } from 'zod'; 2 3 export const referenceSchema = z.object({ 4 link: z.string(), 5 article: z changed this line in version 4 of the diff
- Resolved by Tadeusz Miesiąc
- src/redux/drugs/drugs.reducers.ts 0 → 100644
1 import { ActionReducerMapBuilder } from '@reduxjs/toolkit'; 2 import { DrugsState } from './drugs.types'; 3 import { getDrugs } from './drugs.thunks'; 4 5 export const getDrugsReducer = (builder: ActionReducerMapBuilder<DrugsState>): void => { 6 builder.addCase(getDrugs.pending, state => { 7 state.loading = 'pending'; 8 }); 9 builder.addCase(getDrugs.fulfilled, (state, action) => { 10 state.data = action.payload; 11 state.loading = 'succeeded'; 12 }); 13 builder.addCase(getDrugs.rejected, state => { 14 state.loading = 'failed'; 15 // TODO to discuss manage state of failure - Resolved by Tadeusz Miesiąc
added 1 commit
- 62df5565 - refactor(fetch data state type): moved fetching state to abstraction cuz it's repeated few times
added 9 commits
-
62df5565...63598af4 - 8 commits from branch
development
- d55e26c7 - Merge branch 'development' into feature/MIN-57-connect-drug-search-query
-
62df5565...63598af4 - 8 commits from branch
added 1 commit
enabled an automatic merge when the pipeline for f40b81bf succeeds
mentioned in commit bcdd750b
mentioned in merge request !24 (merged)
Please register or sign in to reply