aboutsummaryrefslogtreecommitdiff
path: root/test/content/repositories/KeymapRepository.test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'test/content/repositories/KeymapRepository.test.ts')
-rw-r--r--test/content/repositories/KeymapRepository.test.ts37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/content/repositories/KeymapRepository.test.ts b/test/content/repositories/KeymapRepository.test.ts
new file mode 100644
index 0000000..34704d9
--- /dev/null
+++ b/test/content/repositories/KeymapRepository.test.ts
@@ -0,0 +1,37 @@
+import KeymapRepository, { KeymapRepositoryImpl }
+ from '../../../src/content/repositories/KeymapRepository';
+import { expect } from 'chai';
+
+describe('KeymapRepositoryImpl', () => {
+ let sut: KeymapRepository;
+
+ before(() => {
+ sut = new 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' },
+ ]);
+ });
+ });
+
+ describe('#clear()', () => {
+ it('clears keys', () => {
+ sut.enqueueKey({ key: 'a' });
+ sut.enqueueKey({ key: 'b' });
+ sut.enqueueKey({ key: 'c' });
+ sut.clear();
+
+ let sequence = sut.enqueueKey({ key: 'a' });
+ expect(sequence.length()).to.equal(1);
+ });
+ });
+});
+
+