Skip to content

Commit a5436be

Browse files
committed
Add tests
1 parent 00ef93b commit a5436be

File tree

4 files changed

+76
-4
lines changed

4 files changed

+76
-4
lines changed

lib/node_modules/@stdlib/plot/sparklines/unicode/tristate/test/test.buffer_size.js

+19-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ tape( 'an instance supports setting and getting the property value', function te
111111
t.end();
112112
});
113113

114-
tape( 'setting the `bufferSize` property triggers a `change` event', function test( t ) {
114+
tape( 'setting the `bufferSize` property to a new value triggers a `change` event', function test( t ) {
115115
var chart;
116116

117117
chart = ctor({
@@ -126,3 +126,21 @@ tape( 'setting the `bufferSize` property triggers a `change` event', function te
126126
t.end();
127127
}
128128
});
129+
130+
tape( 'setting the `bufferSize` property to its current value does not trigger a `change` event', function test( t ) {
131+
var chart;
132+
133+
chart = ctor({
134+
'bufferSize': 10
135+
});
136+
137+
chart.on( 'change', onChange );
138+
chart.bufferSize = 10;
139+
140+
t.ok( true, 'does not trigger event' );
141+
t.end();
142+
143+
function onChange() {
144+
t.ok( false, 'should not trigger event' );
145+
}
146+
});

lib/node_modules/@stdlib/plot/sparklines/unicode/tristate/test/test.description.js

+19-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ tape( 'an instance supports setting and getting the property value', function te
7878
t.end();
7979
});
8080

81-
tape( 'setting the `description` property triggers a `change` event', function test( t ) {
81+
tape( 'setting the `description` property to a new value triggers a `change` event', function test( t ) {
8282
var chart;
8383

8484
chart = ctor({
@@ -93,3 +93,21 @@ tape( 'setting the `description` property triggers a `change` event', function t
9393
t.end();
9494
}
9595
});
96+
97+
tape( 'setting the `description` property to its current value does not trigger a `change` event', function test( t ) {
98+
var chart;
99+
100+
chart = ctor({
101+
'description': 'beep'
102+
});
103+
104+
chart.on( 'change', onChange );
105+
chart.description = 'boop';
106+
107+
t.ok( true, 'does not trigger event' );
108+
t.end();
109+
110+
function onChange() {
111+
t.ok( false, 'should not trigger event' );
112+
}
113+
});

lib/node_modules/@stdlib/plot/sparklines/unicode/tristate/test/test.is_defined.js

+19-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ tape( 'the default behavior is to treat `NaN` values as undefined', function tes
9494
t.end();
9595
});
9696

97-
tape( 'setting the `isDefined` property triggers a `change` event', function test( t ) {
97+
tape( 'setting the `isDefined` property to a new value triggers a `change` event', function test( t ) {
9898
var chart;
9999

100100
chart = ctor({
@@ -113,3 +113,21 @@ tape( 'setting the `isDefined` property triggers a `change` event', function tes
113113
t.end();
114114
}
115115
});
116+
117+
tape( 'setting the `isDefined` property to its current value does not trigger a `change` event', function test( t ) {
118+
var chart;
119+
120+
chart = ctor({
121+
'isDefined': noop
122+
});
123+
124+
chart.on( 'change', onChange );
125+
chart.isDefined = noop;
126+
127+
t.ok( true, 'does not trigger event' );
128+
t.end();
129+
130+
function onChange() {
131+
t.ok( false, 'should not trigger event' );
132+
}
133+
});

lib/node_modules/@stdlib/plot/sparklines/unicode/tristate/test/test.label.js

+19-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ tape( 'an instance supports setting and getting the property value', function te
7676
t.end();
7777
});
7878

79-
tape( 'setting the `label` property triggers a `change` event', function test( t ) {
79+
tape( 'setting the `label` property to a new value triggers a `change` event', function test( t ) {
8080
var chart;
8181

8282
chart = ctor({
@@ -91,3 +91,21 @@ tape( 'setting the `label` property triggers a `change` event', function test( t
9191
t.end();
9292
}
9393
});
94+
95+
tape( 'setting the `label` property to its current value does not trigger a `change` event', function test( t ) {
96+
var chart;
97+
98+
chart = ctor({
99+
'label': 'a'
100+
});
101+
102+
chart.on( 'change', onChange );
103+
chart.label = 'a';
104+
105+
t.ok( true, 'does not trigger event' );
106+
t.end();
107+
108+
function onChange() {
109+
t.ok( false, 'should not trigger event' );
110+
}
111+
});

0 commit comments

Comments
 (0)