Skip to content

Commit 9b62e74

Browse files
committed
Add tests
1 parent a1b8a69 commit 9b62e74

File tree

1 file changed

+38
-0
lines changed
  • lib/node_modules/@stdlib/plot/components/svg/rug/test

1 file changed

+38
-0
lines changed

lib/node_modules/@stdlib/plot/components/svg/rug/test/test.color.js

+38
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,44 @@ tape( 'an instance throws an error if provided an invalid `color` value', functi
5151
}
5252
});
5353

54+
tape( 'an instance supports setting and getting the property value (string)', function test( t ) {
55+
var node;
56+
57+
node = ctor({
58+
'autoRender': false,
59+
'color': '#abc'
60+
});
61+
t.strictEqual( node.color, 'abc', 'returns expected value' );
62+
63+
node.color = '#cba';
64+
t.strictEqual( node.color, '#cba', 'returns expected value' );
65+
66+
t.end();
67+
});
68+
69+
tape( 'an instance supports setting and getting the property value (function)', function test( t ) {
70+
var node;
71+
72+
node = ctor({
73+
'autoRender': false,
74+
'color': color1
75+
});
76+
t.strictEqual( node.color, color1, 'returns expected value' );
77+
78+
node.color = color2;
79+
t.strictEqual( node.color, color2, 'returns expected value' );
80+
81+
t.end();
82+
83+
function color1() {
84+
// no-op...
85+
}
86+
87+
function color2() {
88+
// no-op...
89+
}
90+
});
91+
5492
tape( 'setting the `color` property triggers a `change` event', function test( t ) {
5593
var node = ctor({
5694
'color': '#aaa'

0 commit comments

Comments
 (0)