consome as store/reducers
This commit is contained in:
parent
6127fdc285
commit
83cb277ba2
17 changed files with 171 additions and 236 deletions
|
@ -1,14 +0,0 @@
|
|||
import { expect } from "chai";
|
||||
import actions from '../../src/actions';
|
||||
import * as backgroundActions from '../../src/actions/background';
|
||||
|
||||
describe("background actions", () => {
|
||||
describe("requestCompletions", () => {
|
||||
it('create BACKGROUND_REQUEST_COMPLETIONS action', () => {
|
||||
let action = backgroundActions.requestCompletions('buffer hoge fuga');
|
||||
expect(action.type).to.equal(actions.BACKGROUND_REQUEST_COMPLETIONS);
|
||||
expect(action.command).to.equal('buffer');
|
||||
expect(action.keywords).to.equal('hoge fuga');
|
||||
});
|
||||
});
|
||||
});
|
|
@ -1,51 +0,0 @@
|
|||
import { expect } from "chai";
|
||||
import actions from '../../src/actions';
|
||||
import * as commandActions from '../../src/actions/command';
|
||||
|
||||
describe("command actions", () => {
|
||||
describe("exec", () => {
|
||||
context("open command", () => {
|
||||
it('create COMMAND_OPEN_URL acion with a full url', () => {
|
||||
let action = commandActions.exec("open https://github.com/")
|
||||
expect(action.type).to.equal(actions.COMMAND_OPEN_URL);
|
||||
expect(action.url).to.equal('https://github.com/');
|
||||
});
|
||||
|
||||
it('create COMMAND_OPEN_URL acion with a domain name', () => {
|
||||
let action = commandActions.exec("open github.com")
|
||||
expect(action.type).to.equal(actions.COMMAND_OPEN_URL);
|
||||
expect(action.url).to.equal('http://github.com');
|
||||
});
|
||||
});
|
||||
|
||||
context("tabopen command", () => {
|
||||
it('create COMMAND_TABOPEN_URL acion with a full url', () => {
|
||||
let action = commandActions.exec("tabopen https://github.com/")
|
||||
expect(action.type).to.equal(actions.COMMAND_TABOPEN_URL);
|
||||
expect(action.url).to.equal('https://github.com/');
|
||||
});
|
||||
|
||||
it('create COMMAND_TABOPEN_URL acion with a domain name', () => {
|
||||
let action = commandActions.exec("tabopen github.com")
|
||||
expect(action.type).to.equal(actions.COMMAND_TABOPEN_URL);
|
||||
expect(action.url).to.equal('http://github.com');
|
||||
});
|
||||
});
|
||||
|
||||
context("buffer command", () => {
|
||||
it('create COMMAND_BUFFER acion with a keywords', () => {
|
||||
let action = commandActions.exec("buffer foo bar")
|
||||
expect(action.type).to.equal(actions.COMMAND_BUFFER);
|
||||
expect(action.keywords).to.equal('foo bar');
|
||||
});
|
||||
});
|
||||
|
||||
context("b command", () => {
|
||||
it('create COMMAND_BUFFER acion with a keywords', () => {
|
||||
let action = commandActions.exec("b foo bar")
|
||||
expect(action.type).to.equal(actions.COMMAND_BUFFER);
|
||||
expect(action.keywords).to.equal('foo bar');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
Reference in a new issue