mirror of
https://github.com/microsoft/frontend-bootcamp.git
synced 2026-01-26 14:56:42 +08:00
11 lines
349 B
TypeScript
11 lines
349 B
TypeScript
import { reducer } from '../index';
|
|
|
|
describe('reducers', () => {
|
|
it('should add item to the list', () => {
|
|
const newStore = reducer({ todos: {}, filter: 'all' }, { type: 'add', label: 'hello' });
|
|
const keys = Object.keys(newStore.todos);
|
|
expect(keys.length).toBe(1);
|
|
expect(newStore.todos[keys[0]].label).toBe('hello');
|
|
});
|
|
});
|