This repository has been archived on 2022-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
outline/app/stores/ErrorsStore.test.js
2017-10-25 22:49:04 -07:00

28 lines
631 B
JavaScript

/* eslint-disable */
import ErrorsStore from './ErrorsStore';
// Actions
describe('ErrorsStore', () => {
let store;
beforeEach(() => {
store = new ErrorsStore();
});
test('#add should add errors', () => {
expect(store.data.length).toBe(0);
store.add('first error');
store.add('second error');
expect(store.data.length).toBe(2);
});
test('#remove should remove errors', () => {
store.add('first error');
store.add('second error');
expect(store.data.length).toBe(2);
store.remove(0);
expect(store.data.length).toBe(1);
expect(store.data[0]).toBe('second error');
});
});