aboutsummaryrefslogtreecommitdiff
path: root/test/pages/completion.test.js
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2017-09-30 22:51:18 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2017-09-30 22:51:18 +0900
commit567b696cecbec870c36f5a07dd02fb5d9f9efb9b (patch)
treec31ac48d3da4dfe9801c85d9a954bc112df87a88 /test/pages/completion.test.js
parent6551420e1ae0e91201de72e862e918dd3c97ab43 (diff)
redux in console
Diffstat (limited to 'test/pages/completion.test.js')
-rw-r--r--test/pages/completion.test.js48
1 files changed, 0 insertions, 48 deletions
diff --git a/test/pages/completion.test.js b/test/pages/completion.test.js
deleted file mode 100644
index 28dd9a7..0000000
--- a/test/pages/completion.test.js
+++ /dev/null
@@ -1,48 +0,0 @@
-import { expect } from "chai";
-import Completion from '../../src/pages/completion';
-
-describe('Completion class', () => {
- describe('#constructor', () => {
- it('creates new object by iterable items', () => {
- new Completion([1,2,3,4,5]);
- new Completion([]);
- new Completion('hello');
- new Completion('');
- });
-
- it('creates new object by iterable items', () => {
- expect(() => new Completion({ key: 'value' })).to.throw(TypeError);
- expect(() => new Completion(12345)).to.throw(TypeError);
- });
- });
-
- describe('#next', () => {
- it('complete next items', () => {
- let completion = new Completion([3, 4, 5]);
- expect(completion.next()).to.equal(3);
- expect(completion.next()).to.equal(4);
- expect(completion.next()).to.equal(5);
- expect(completion.next()).to.equal(3);
- });
-
- it('returns null when empty completions', () => {
- let completion = new Completion([]);
- expect(completion.next()).to.be.null;
- });
- });
-
- describe('#prev', () => {
- it('complete prev items', () => {
- let completion = new Completion([3, 4, 5]);
- expect(completion.prev()).to.equal(5);
- expect(completion.prev()).to.equal(4);
- expect(completion.prev()).to.equal(3);
- expect(completion.prev()).to.equal(5);
- });
-
- it('returns null when empty completions', () => {
- let completion = new Completion([]);
- expect(completion.prev()).to.be.null;
- });
- });
-});