chore: prepare todolists reducer for rtk (use single argument in action creators)

This commit is contained in:
2024-08-17 17:51:19 +02:00
parent 73fbe68b9f
commit f154e0385a
3 changed files with 38 additions and 11 deletions

View File

@@ -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)