A fork of https://github.com/ueokande/vim-vixen
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.1 KiB
39 lines
1.1 KiB
import KeymapRepository, { KeymapRepositoryImpl } |
|
from '../../../src/content/repositories/KeymapRepository'; |
|
import Key from '../../../src/content/domains/Key' |
|
import { expect } from 'chai'; |
|
|
|
describe('KeymapRepositoryImpl', () => { |
|
let sut: KeymapRepository; |
|
|
|
before(() => { |
|
sut = new KeymapRepositoryImpl(); |
|
}); |
|
|
|
describe('#enqueueKey()', () => { |
|
it('enqueues keys', () => { |
|
sut.enqueueKey(Key.fromMapKey('a'); |
|
sut.enqueueKey(Key.fromMapKey('b'); |
|
let sequence = sut.enqueueKey(Key.fromMapKey('c')); |
|
|
|
let keys = sequence.keys; |
|
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.fromMapKey('a')); |
|
sut.enqueueKey(Key.fromMapKey('b')); |
|
sut.enqueueKey(Key.fromMapKey('c')); |
|
sut.clear(); |
|
|
|
let sequence = sut.enqueueKey(Key.fromMapKey('a')); |
|
expect(sequence.length()).to.equal(1); |
|
}); |
|
}); |
|
}); |
|
|
|
|
|
|