trc-client-core
Version:
The core of the TRC Client
26 lines (21 loc) • 1.08 kB
JavaScript
import test from 'tape';
import {is, fromJS} from 'immutable';
import ParticipantStore from '../ParticipantStore';
test('ParticipantStore.init - has no data to start', tt => {
tt.plan(3);
tt.notOk(ParticipantStore.get('currentParticipant'), 'currentParticipant should be null');
tt.notOk(ParticipantStore.get('searchResults'), 'searchResults should be null');
tt.notOk(ParticipantStore.get('managers'), 'managers should be null');
});
test('ParticipantStore.onSearchCompleted - fetches user search results successfully.', tt => {
tt.plan(1);
var participants = fromJS([{user: 'test_user'}]);
ParticipantStore.onSearchCompleted(participants);
tt.ok(is(ParticipantStore.get('searchResults'), participants), 'searchResults should be set');
});
test('ParticipantStore.onFetchManagersCompleted - fetches managers successfully', tt => {
tt.plan(1);
var managers = fromJS([{manager: 'test_manager'}]);
ParticipantStore.onFetchManagersCompleted(managers);
tt.ok(is(ParticipantStore.get('managers'), managers), 'managers should be set');
});