Skip to content

Commit

Permalink
Add selection specs
Browse files Browse the repository at this point in the history
  • Loading branch information
Christof authored and LFDM committed May 27, 2014
1 parent ce9cc88 commit bc74f0d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions spec/arethusa.core/state.service_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,28 @@ describe("state", function() {
});
});

describe('selection', function() {
it('selects the clicked token', function() {
state.selectToken('03', 'click');

expect(state.selectedTokens).toEqual({'03': 'click'});
});

it('deselects all tokens after head change', function() {
state.selectToken('01', 'click');
state.selectToken('03', 'click');

expect(state.selectedTokens).toEqual({});
});

it('selects multiple tokens with ctrl', function() {
state.selectToken('01', 'ctrl-click');
state.selectToken('03', 'ctrl-click');

expect(state.selectedTokens).toEqual({'01': 'ctrl-click', '03': 'ctrl-click'});
});
});

/* Default tree:
* 04:cano
* |
Expand Down

0 comments on commit bc74f0d

Please sign in to comment.