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: add prettier and run it on all files
This commit is contained in:
@@ -1,27 +1,31 @@
|
||||
import {addTodolistAC, TodolistDomainType, todolistsReducer} from './todolists-reducer'
|
||||
import {tasksReducer, TasksStateType} from './tasks-reducer'
|
||||
import {TodolistType} from '../../api/todolists-api'
|
||||
import {
|
||||
addTodolistAC,
|
||||
TodolistDomainType,
|
||||
todolistsReducer,
|
||||
} from './todolists-reducer'
|
||||
import { tasksReducer, TasksStateType } from './tasks-reducer'
|
||||
import { TodolistType } from '../../api/todolists-api'
|
||||
|
||||
test('ids should be equals', () => {
|
||||
const startTasksState: TasksStateType = {};
|
||||
const startTodolistsState: Array<TodolistDomainType> = [];
|
||||
const startTasksState: TasksStateType = {}
|
||||
const startTodolistsState: Array<TodolistDomainType> = []
|
||||
|
||||
let todolist: TodolistType = {
|
||||
title: 'new todolist',
|
||||
id: 'any id',
|
||||
addedDate: '',
|
||||
order: 0
|
||||
}
|
||||
let todolist: TodolistType = {
|
||||
title: 'new todolist',
|
||||
id: 'any id',
|
||||
addedDate: '',
|
||||
order: 0,
|
||||
}
|
||||
|
||||
const action = addTodolistAC(todolist);
|
||||
const action = addTodolistAC(todolist)
|
||||
|
||||
const endTasksState = tasksReducer(startTasksState, action)
|
||||
const endTodolistsState = todolistsReducer(startTodolistsState, action)
|
||||
const endTasksState = tasksReducer(startTasksState, action)
|
||||
const endTodolistsState = todolistsReducer(startTodolistsState, action)
|
||||
|
||||
const keys = Object.keys(endTasksState);
|
||||
const idFromTasks = keys[0];
|
||||
const idFromTodolists = endTodolistsState[0].id;
|
||||
const keys = Object.keys(endTasksState)
|
||||
const idFromTasks = keys[0]
|
||||
const idFromTodolists = endTodolistsState[0].id
|
||||
|
||||
expect(idFromTasks).toBe(action.todolist.id);
|
||||
expect(idFromTodolists).toBe(action.todolist.id);
|
||||
});
|
||||
expect(idFromTasks).toBe(action.todolist.id)
|
||||
expect(idFromTodolists).toBe(action.todolist.id)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user