mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
add checks for the value of parent state
This commit is contained in:
parent
7099ebdfb2
commit
7949784f0e
1 changed files with 4 additions and 5 deletions
|
@ -119,8 +119,9 @@ describe('Persisted State', function () {
|
|||
var persistedState = new PersistedState();
|
||||
childState = persistedState.createChild(childIndex);
|
||||
|
||||
// parent state should contain the child and its original state
|
||||
// parent state should not contain the child state
|
||||
expect(persistedState.get()).to.not.have.property(childIndex);
|
||||
expect(persistedState.get()).to.eql({});
|
||||
});
|
||||
|
||||
it('should not append the child state to the parent, with parent value', function () {
|
||||
|
@ -132,8 +133,9 @@ describe('Persisted State', function () {
|
|||
// child state should be empty, we didn't give it any default data
|
||||
expect(childState.get()).to.be(undefined);
|
||||
|
||||
// parent state should contain the child and its original state value
|
||||
// parent state should not contain the child state
|
||||
expect(persistedState.get()).to.not.have.property(childIndex);
|
||||
expect(persistedState.get()).to.eql(persistedStateValue);
|
||||
});
|
||||
|
||||
it('should append the child state to the parent, with parent and child values', function () {
|
||||
|
@ -143,9 +145,6 @@ describe('Persisted State', function () {
|
|||
var persistedState = new PersistedState(persistedStateValue);
|
||||
childState = persistedState.createChild(childIndex, childStateValue);
|
||||
|
||||
// child state should be empty, we didn't give it any default data
|
||||
expect(childState.get()).to.eql(childStateValue);
|
||||
|
||||
// parent state should contain the child and its original state value
|
||||
var parentState = persistedState.get();
|
||||
expect(parentState).to.have.property('original', true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue