From 3505ed3ad0c439e6aa1d7d404b2fa689243545e5 Mon Sep 17 00:00:00 2001 From: Jori Lallo Date: Wed, 28 Feb 2018 23:21:17 -0800 Subject: [PATCH] Removed quite useless store test --- app/stores/CollectionsStore.test.js | 43 ----------------------------- 1 file changed, 43 deletions(-) delete mode 100644 app/stores/CollectionsStore.test.js diff --git a/app/stores/CollectionsStore.test.js b/app/stores/CollectionsStore.test.js deleted file mode 100644 index 841ca4efa..000000000 --- a/app/stores/CollectionsStore.test.js +++ /dev/null @@ -1,43 +0,0 @@ -/* eslint-disable */ -import CollectionsStore from './CollectionsStore'; -const { client } = require('utils/ApiClient'); - -describe('CollectionsStore', () => { - let store; - - beforeEach(() => { - store = new CollectionsStore({}); - }); - - describe('#fetchPage', () => { - test('should load stores', async () => { - client.post = jest.fn(() => ({ - data: [ - { - id: 123, - name: 'New collection', - }, - ], - })) - - await store.fetchPage(); - - expect(client.post).toHaveBeenCalledWith('/collections.list', undefined); - expect(store.data.size).toBe(1); - expect(store.data.values()[0].name).toBe('New collection'); - }); - - test('should report errors', async () => { - client.post = jest.fn(() => Promise.reject()) - store.errors = { - add: jest.fn(), - }; - - await store.fetchPage(); - - expect(store.errors.add).toHaveBeenCalledWith( - 'Failed to load collections' - ); - }); - }); -});