Skip to content

Commit 289edce

Browse files
committed
test: update font-style and font-weight tests to use valid enum values
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent fa696ef commit 289edce

2 files changed

Lines changed: 32 additions & 28 deletions

File tree

lib/node_modules/@stdlib/plot/vega/title/ctor/test/test.font_style.js

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ tape( 'the constructor returns an instance which has a `fontStyle` property', fu
4343
t.strictEqual( isUndefined( v.fontStyle ), true, 'returns expected value' );
4444

4545
v = new Title({
46-
'fontStyle': 'Arial'
46+
'fontStyle': 'italic'
4747
});
4848
t.strictEqual( isString( v.fontStyle ), true, 'returns expected value' );
4949

@@ -55,6 +55,8 @@ tape( 'the constructor returns an instance having a `fontStyle` property which t
5555
var i;
5656

5757
values = [
58+
'Arial',
59+
'foo',
5860
5,
5961
NaN,
6062
null,
@@ -82,26 +84,26 @@ tape( 'the constructor returns an instance having a `fontStyle` property', funct
8284
t.strictEqual( isUndefined( title.fontStyle ), true, 'returns expected value' );
8385

8486
title = new Title({
85-
'fontStyle': 'Arial'
87+
'fontStyle': 'italic'
8688
});
87-
t.strictEqual( title.fontStyle, 'Arial', 'returns expected value' );
89+
t.strictEqual( title.fontStyle, 'italic', 'returns expected value' );
8890

8991
title = new Title({
90-
'fontStyle': 'Sans'
92+
'fontStyle': 'oblique'
9193
});
92-
t.strictEqual( title.fontStyle, 'Sans', 'returns expected value' );
94+
t.strictEqual( title.fontStyle, 'oblique', 'returns expected value' );
9395

9496
t.end();
9597
});
9698

9799
tape( 'the constructor returns an instance having a `fontStyle` property which can be set to a valid value', function test( t ) {
98100
var title = new Title();
99101

100-
title.fontStyle = 'Arial';
101-
t.strictEqual( title.fontStyle, 'Arial', 'returns expected value' );
102+
title.fontStyle = 'italic';
103+
t.strictEqual( title.fontStyle, 'italic', 'returns expected value' );
102104

103-
title.fontStyle = 'Sans';
104-
t.strictEqual( title.fontStyle, 'Sans', 'returns expected value' );
105+
title.fontStyle = 'oblique';
106+
t.strictEqual( title.fontStyle, 'oblique', 'returns expected value' );
105107

106108
t.end();
107109
});
@@ -115,14 +117,14 @@ tape( 'the constructor returns an instance which emits an event when the `fontSt
115117

116118
title.on( 'change', onChange );
117119

118-
title.fontStyle = 'Sans';
120+
title.fontStyle = 'italic';
119121
t.strictEqual( count, 1, 'returns expected value' );
120122

121-
title.fontStyle = 'Arial';
123+
title.fontStyle = 'oblique';
122124
t.strictEqual( count, 2, 'returns expected value' );
123125

124126
// Setting to the same value should not emit an event:
125-
title.fontStyle = 'Arial';
127+
title.fontStyle = 'oblique';
126128
t.strictEqual( count, 2, 'returns expected value' );
127129

128130
t.end();

lib/node_modules/@stdlib/plot/vega/title/ctor/test/test.font_weight.js

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ var hasOwnProp = require( '@stdlib/assert/has-own-property' );
2525
var isUndefined = require( '@stdlib/assert/is-undefined' );
2626
var hasProp = require( '@stdlib/assert/has-property' );
2727
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
28-
var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;
2928
var Title = require( './../lib' );
3029

3130

@@ -49,9 +48,9 @@ tape( 'the constructor returns an instance which has a `fontWeight` property', f
4948
t.strictEqual( isString( v.fontWeight ), true, 'returns expected value' );
5049

5150
v = new Title({
52-
'fontWeight': 6
51+
'fontWeight': 600
5352
});
54-
t.strictEqual( isNumber( v.fontWeight ), true, 'returns expected value' );
53+
t.strictEqual( isString( v.fontWeight ), true, 'returns expected value' );
5554

5655
t.end();
5756
});
@@ -61,6 +60,9 @@ tape( 'the constructor returns an instance having a `fontWeight` property which
6160
var i;
6261

6362
values = [
63+
'foo',
64+
6,
65+
NaN,
6466
null,
6567
true,
6668
false,
@@ -91,19 +93,19 @@ tape( 'the constructor returns an instance having a `fontWeight` property', func
9193
t.strictEqual( title.fontWeight, 'bold', 'returns expected value' );
9294

9395
title = new Title({
94-
'fontWeight': 'light'
96+
'fontWeight': 'lighter'
9597
});
96-
t.strictEqual( title.fontWeight, 'light', 'returns expected value' );
98+
t.strictEqual( title.fontWeight, 'lighter', 'returns expected value' );
9799

98100
title = new Title({
99-
'fontWeight': 6
101+
'fontWeight': '600'
100102
});
101-
t.strictEqual( title.fontWeight, 6, 'returns expected value' );
103+
t.strictEqual( title.fontWeight, '600', 'returns expected value' );
102104

103105
title = new Title({
104-
'fontWeight': 8
106+
'fontWeight': 800
105107
});
106-
t.strictEqual( title.fontWeight, 8, 'returns expected value' );
108+
t.strictEqual( title.fontWeight, '800', 'returns expected value' );
107109

108110
t.end();
109111
});
@@ -114,14 +116,14 @@ tape( 'the constructor returns an instance having a `fontWeight` property which
114116
title.fontWeight = 'bold';
115117
t.strictEqual( title.fontWeight, 'bold', 'returns expected value' );
116118

117-
title.fontWeight = 'light';
118-
t.strictEqual( title.fontWeight, 'light', 'returns expected value' );
119+
title.fontWeight = 'lighter';
120+
t.strictEqual( title.fontWeight, 'lighter', 'returns expected value' );
119121

120-
title.fontWeight = 6;
121-
t.strictEqual( title.fontWeight, 6, 'returns expected value' );
122+
title.fontWeight = '600';
123+
t.strictEqual( title.fontWeight, '600', 'returns expected value' );
122124

123-
title.fontWeight = 8;
124-
t.strictEqual( title.fontWeight, 8, 'returns expected value' );
125+
title.fontWeight = 800;
126+
t.strictEqual( title.fontWeight, '800', 'returns expected value' );
125127

126128
t.end();
127129
});
@@ -135,7 +137,7 @@ tape( 'the constructor returns an instance which emits an event when the `fontWe
135137

136138
title.on( 'change', onChange );
137139

138-
title.fontWeight = 'light';
140+
title.fontWeight = 'lighter';
139141
t.strictEqual( count, 1, 'returns expected value' );
140142

141143
title.fontWeight = 'bold';

0 commit comments

Comments
 (0)