UNPKG

trc-client-core

Version:
60 lines (49 loc) 2.21 kB
// import tape from 'tape'; // import DMTReportStore from 'trc-client-core/src/report/DMTReportStore'; // const DMTReportStore = proxyquire('trc/report/DMTReportStore', { // 'bd-stampy/utils/UrlStore': { // getQueryParams: () => ({ // regionCode: 'ERO' // }) // } // }) // tape('DMTReportStore.onFetchDmtDataCompleted', (test) => { // test.plan(1); // DMTReportStore.onFetchDmtDataCompleted({}); // test.ok(DMTReportStore.get('dmtReports'), 'data gets put into the store'); // // test.skip(); // }); // describe('DMTReportStore', function () { // // describe('init', function () { // // it('gets a default region from the query string', function () { // // var DMTReportStore = require('../DMTReportStore'); // // DMTReportStore.init(); // // expect(DMTReportStore.get('region')).toBe('ALL_REGIONS'); // // }); // // it('dmtReport defaults to null if dmtReports is undefined', function () { // // var DMTReportStore = require('../DMTReportStore'); // // DMTReportStore.init(); // // expect(DMTReportStore.get('dmtReport')).toBe(null); // // }); // // }); // describe('onFetchDmtDataCompleted', function () { // it('sets dmtReports from server', function () { // var DMTReportStore = require('../DMTReportStore'); // DMTReportStore.onFetchDmtDataCompleted({}); // expect(DMTReportStore.get('dmtReports')).toBeDefined(); // }); // it('sets the individual report', function () { // var DMTReportStore = require('../DMTReportStore'); // DMTReportStore.onFetchDmtDataCompleted({}); // expect(DMTReportStore.get('dmtReport')).toBeDefined(); // }); // }); // describe('onChangeRegion', function () { // it('changes the region', function () { // var DMTReportStore = require('../DMTReportStore'); // DMTReportStore.setState({dmtReports: {}}); // DMTReportStore.onChangeRegion('ERO'); // expect(DMTReportStore.get('region')).toBe('ERO'); // }); // }); // });