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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

38 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);
});
});
});