github
228 of 365 branches covered (62.47%)
Branch coverage included in aggregate %.
474 of 553 new or added lines in 13 files covered. (85.71%)
17 existing lines in 1 file now uncovered.3168 of 3575 relevant lines covered (88.62%)
4.22 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✔ |