mirror of
https://github.com/ershisan99/it-incubator-todolist-ts-17-live-2024-08-17.git
synced 2026-02-04 21:02:13 +00:00
chore: prepare todolists reducer for rtk (use single argument in action creators)
This commit is contained in:
@@ -65,7 +65,10 @@ test('correct todolist should be added', () => {
|
||||
test('correct todolist should change its name', () => {
|
||||
let newTodolistTitle = 'New Todolist'
|
||||
|
||||
const action = changeTodolistTitleAC(todolistId2, newTodolistTitle)
|
||||
const action = changeTodolistTitleAC({
|
||||
id: todolistId2,
|
||||
title: newTodolistTitle,
|
||||
})
|
||||
|
||||
const endState = todolistsReducer(startState, action)
|
||||
|
||||
@@ -76,7 +79,7 @@ test('correct todolist should change its name', () => {
|
||||
test('correct filter of todolist should be changed', () => {
|
||||
let newFilter: FilterValuesType = 'completed'
|
||||
|
||||
const action = changeTodolistFilterAC(todolistId2, newFilter)
|
||||
const action = changeTodolistFilterAC({ id: todolistId2, filter: newFilter })
|
||||
|
||||
const endState = todolistsReducer(startState, action)
|
||||
|
||||
@@ -93,7 +96,10 @@ test('todolists should be added', () => {
|
||||
test('correct entity status of todolist should be changed', () => {
|
||||
let newStatus: RequestStatusType = 'loading'
|
||||
|
||||
const action = changeTodolistEntityStatusAC(todolistId2, newStatus)
|
||||
const action = changeTodolistEntityStatusAC({
|
||||
id: todolistId2,
|
||||
status: newStatus,
|
||||
})
|
||||
|
||||
const endState = todolistsReducer(startState, action)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user