aboutsummaryrefslogtreecommitdiff
path: root/test/content/repositories
diff options
context:
space:
mode:
Diffstat (limited to 'test/content/repositories')
-rw-r--r--test/content/repositories/KeymapRepository.test.ts24
1 files changed, 13 insertions, 11 deletions
diff --git a/test/content/repositories/KeymapRepository.test.ts b/test/content/repositories/KeymapRepository.test.ts
index 34704d9..8f0be67 100644
--- a/test/content/repositories/KeymapRepository.test.ts
+++ b/test/content/repositories/KeymapRepository.test.ts
@@ -1,5 +1,6 @@
import KeymapRepository, { KeymapRepositoryImpl }
from '../../../src/content/repositories/KeymapRepository';
+import Key from '../../../src/content/domains/Key'
import { expect } from 'chai';
describe('KeymapRepositoryImpl', () => {
@@ -11,24 +12,25 @@ describe('KeymapRepositoryImpl', () => {
describe('#enqueueKey()', () => {
it('enqueues keys', () => {
- sut.enqueueKey({ key: 'a' });
- sut.enqueueKey({ key: 'b' });
- let sequence = sut.enqueueKey({ key: 'c' });
-
- expect(sequence.getKeyArray()).deep.equals([
- { key: 'a' }, { key: 'b' }, { key: 'c' },
- ]);
+ sut.enqueueKey(Key.fromMapKey('a');
+ sut.enqueueKey(Key.fromMapKey('b');
+ let sequence = sut.enqueueKey(Key.fromMapKey('c'));
+
+ let keys = sequence.getKeyArray();
+ expect(keys[0].equals(Key.fromMapKey('a'))).to.be.true;
+ expect(keys[1].equals(Key.fromMapKey('b'))).to.be.true;
+ expect(keys[2].equals(Key.fromMapKey('c'))).to.be.true;
});
});
describe('#clear()', () => {
it('clears keys', () => {
- sut.enqueueKey({ key: 'a' });
- sut.enqueueKey({ key: 'b' });
- sut.enqueueKey({ key: 'c' });
+ sut.enqueueKey(Key.fromMapKey('a');
+ sut.enqueueKey(Key.fromMapKey('b');
+ sut.enqueueKey(Key.fromMapKey('c');
sut.clear();
- let sequence = sut.enqueueKey({ key: 'a' });
+ let sequence = sut.enqueueKey(Key.fromMapKey('a'));
expect(sequence.length()).to.equal(1);
});
});