Store x position into marks
This commit is contained in:
parent
e6d990966a
commit
f66e75575d
4 changed files with 10 additions and 6 deletions
|
@ -25,9 +25,10 @@ describe('mark actions', () => {
|
|||
|
||||
describe('setLocal', () => {
|
||||
it('create setLocal action', () => {
|
||||
let action = markActions.setLocal('a', 30);
|
||||
let action = markActions.setLocal('a', 20, 30);
|
||||
expect(action.type).to.equal(actions.MARK_SET_LOCAL);
|
||||
expect(action.key).to.equal('a');
|
||||
expect(action.x).to.equal(20);
|
||||
expect(action.y).to.equal(30);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -31,9 +31,11 @@ describe("mark reducer", () => {
|
|||
});
|
||||
|
||||
it('stores local mark', () => {
|
||||
let action = { type: actions.MARK_SET_LOCAL, key: 'a', y: 10 };
|
||||
let state = reducer(undefined, action);
|
||||
let action = { type: actions.MARK_SET_LOCAL, key: 'a', x: 20, y: 30};
|
||||
let state = reducer({ setMode: true }, action);
|
||||
expect(state.setMode).to.be.false;
|
||||
expect(state.marks['a']).to.be.an('object')
|
||||
expect(state.marks['a'].y).to.equal(10)
|
||||
expect(state.marks['a'].x).to.equal(20)
|
||||
expect(state.marks['a'].y).to.equal(30)
|
||||
});
|
||||
});
|
||||
|
|
Reference in a new issue