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.
37 lines
899 B
37 lines
899 B
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); |
|
}); |
|
}); |
|
}); |
|
|
|
|
|
|