github
237 of 373 branches covered (63.54%)
Branch coverage included in aggregate %.
494 of 566 new or added lines in 12 files covered. (87.28%)
17 existing lines in 1 file now uncovered.3208 of 3588 relevant lines covered (89.41%)
5.14 hits per line
|
import { createSlice } from '@reduxjs/toolkit'; |
1✔ |
|
|
1✔ |
|
const initialState = {
|
1✔ |
|
categories: {
|
1✔ |
|
Women: 0, |
1✔ |
|
Men: 0,
|
1✔ |
|
Kids: 0,
|
1✔ |
|
Electronics: 0,
|
1✔ |
|
Fashion: 0,
|
1✔ |
|
Accessories: 0,
|
1✔ |
|
Jewelries: 0
|
1✔ |
|
}, |
1✔ |
|
currentCategory: '' |
1✔ |
|
}; |
1✔ |
|
|
1✔ |
|
const categorySlice = createSlice({
|
1✔ |
|
name: 'category', |
1✔ |
|
initialState: initialState, |
1✔ |
|
reducers: { |
1✔ |
|
setCategoryObj: (state, action) => {
|
1✔ |
NEW
|
state.categories = action.payload; |
× |
NEW
|
}, |
× |
|
setCurrentCategory: (state, action) => {
|
1✔ |
NEW
|
state.currentCategory = action.payload; |
× |
NEW
|
} |
× |
|
} |
1✔ |
|
}); |
1✔ |
|
|
1✔ |
|
export const { setCategoryObj, setCurrentCategory } = categorySlice.actions; |
1✔ |
|
export default categorySlice.reducer; |
1✔ |