Skip to content

Commit

Permalink
Add failing test for issue metal#287
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert-Frampton authored and Robert-Frampton committed Oct 31, 2017
1 parent cbb22f4 commit 94466c1
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions packages/metal-state/test/State.js
Original file line number Diff line number Diff line change
Expand Up @@ -1041,6 +1041,32 @@ describe('State', function() {
assert.strictEqual('foo2', test2.key1);
assert.strictEqual('foo1', test1.key1);
});

it('should configure static STATE with multiple levels of class inheritance', function() {
var Test = createTestClass();
Test.STATE = {
key1: {
}
};

class Child extends Test {
}
Child.STATE = {
key2: {
}
};

var test = new Test({
key1: 'foo1'
});
assert.strictEqual('foo1', test.key1);

var child = new Child({
key2: 'foo2'
});
assert.strictEqual('foo1', test.key1);
assert.strictEqual('foo2', child.key2);
});
});

describe('Separate object', function() {
Expand Down

0 comments on commit 94466c1

Please sign in to comment.