trc-client-core
Version:
The core of the TRC Client
36 lines (28 loc) • 936 B
JavaScript
import FDLPStore from 'trc-client-core/src/management/fdlp/FDLPStore';
describe('FdlpStore', () => {
const EXPECTED_SESSION = ['1','2','3'];
const EXPECTED = [
{
userGroupName: 'TEST_GROUP',
programData: {
sessions: EXPECTED_SESSION
}
}
];
beforeEach(() => {
FDLPStore.init();
});
describe('init', () => {
it('set sets the inital null states', () => {
FDLPStore.init();
expect(FDLPStore.get('firstGroupName')).toBe(null);
expect(FDLPStore.get('sessions').size).toBe(0);
});
});
describe('onGetSessionDataCompleted', () => {
it('turns the endpoints collection into a map', () => {
FDLPStore.onGetSessionDataCompleted(EXPECTED);
expect(FDLPStore.get('sessions').get('TEST_GROUP').toJS()).toEqual(EXPECTED_SESSION);
});
});
});