From 289edcee7a08810c1b36485d238f1c554072c163 Mon Sep 17 00:00:00 2001 From: orthodox-64 Date: Tue, 5 May 2026 02:19:12 +0530 Subject: [PATCH] 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 --- --- .../vega/title/ctor/test/test.font_style.js | 26 +++++++------- .../vega/title/ctor/test/test.font_weight.js | 34 ++++++++++--------- 2 files changed, 32 insertions(+), 28 deletions(-) diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/test/test.font_style.js b/lib/node_modules/@stdlib/plot/vega/title/ctor/test/test.font_style.js index 937e9cb8bac9..f4c1d50fb9bc 100644 --- a/lib/node_modules/@stdlib/plot/vega/title/ctor/test/test.font_style.js +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/test/test.font_style.js @@ -43,7 +43,7 @@ tape( 'the constructor returns an instance which has a `fontStyle` property', fu t.strictEqual( isUndefined( v.fontStyle ), true, 'returns expected value' ); v = new Title({ - 'fontStyle': 'Arial' + 'fontStyle': 'italic' }); t.strictEqual( isString( v.fontStyle ), true, 'returns expected value' ); @@ -55,6 +55,8 @@ tape( 'the constructor returns an instance having a `fontStyle` property which t var i; values = [ + 'Arial', + 'foo', 5, NaN, null, @@ -82,14 +84,14 @@ tape( 'the constructor returns an instance having a `fontStyle` property', funct t.strictEqual( isUndefined( title.fontStyle ), true, 'returns expected value' ); title = new Title({ - 'fontStyle': 'Arial' + 'fontStyle': 'italic' }); - t.strictEqual( title.fontStyle, 'Arial', 'returns expected value' ); + t.strictEqual( title.fontStyle, 'italic', 'returns expected value' ); title = new Title({ - 'fontStyle': 'Sans' + 'fontStyle': 'oblique' }); - t.strictEqual( title.fontStyle, 'Sans', 'returns expected value' ); + t.strictEqual( title.fontStyle, 'oblique', 'returns expected value' ); t.end(); }); @@ -97,11 +99,11 @@ tape( 'the constructor returns an instance having a `fontStyle` property', funct tape( 'the constructor returns an instance having a `fontStyle` property which can be set to a valid value', function test( t ) { var title = new Title(); - title.fontStyle = 'Arial'; - t.strictEqual( title.fontStyle, 'Arial', 'returns expected value' ); + title.fontStyle = 'italic'; + t.strictEqual( title.fontStyle, 'italic', 'returns expected value' ); - title.fontStyle = 'Sans'; - t.strictEqual( title.fontStyle, 'Sans', 'returns expected value' ); + title.fontStyle = 'oblique'; + t.strictEqual( title.fontStyle, 'oblique', 'returns expected value' ); t.end(); }); @@ -115,14 +117,14 @@ tape( 'the constructor returns an instance which emits an event when the `fontSt title.on( 'change', onChange ); - title.fontStyle = 'Sans'; + title.fontStyle = 'italic'; t.strictEqual( count, 1, 'returns expected value' ); - title.fontStyle = 'Arial'; + title.fontStyle = 'oblique'; t.strictEqual( count, 2, 'returns expected value' ); // Setting to the same value should not emit an event: - title.fontStyle = 'Arial'; + title.fontStyle = 'oblique'; t.strictEqual( count, 2, 'returns expected value' ); t.end(); diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/test/test.font_weight.js b/lib/node_modules/@stdlib/plot/vega/title/ctor/test/test.font_weight.js index 9ef9cd6a4339..763531d226c5 100644 --- a/lib/node_modules/@stdlib/plot/vega/title/ctor/test/test.font_weight.js +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/test/test.font_weight.js @@ -25,7 +25,6 @@ var hasOwnProp = require( '@stdlib/assert/has-own-property' ); var isUndefined = require( '@stdlib/assert/is-undefined' ); var hasProp = require( '@stdlib/assert/has-property' ); var isString = require( '@stdlib/assert/is-string' ).isPrimitive; -var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive; var Title = require( './../lib' ); @@ -49,9 +48,9 @@ tape( 'the constructor returns an instance which has a `fontWeight` property', f t.strictEqual( isString( v.fontWeight ), true, 'returns expected value' ); v = new Title({ - 'fontWeight': 6 + 'fontWeight': 600 }); - t.strictEqual( isNumber( v.fontWeight ), true, 'returns expected value' ); + t.strictEqual( isString( v.fontWeight ), true, 'returns expected value' ); t.end(); }); @@ -61,6 +60,9 @@ tape( 'the constructor returns an instance having a `fontWeight` property which var i; values = [ + 'foo', + 6, + NaN, null, true, false, @@ -91,19 +93,19 @@ tape( 'the constructor returns an instance having a `fontWeight` property', func t.strictEqual( title.fontWeight, 'bold', 'returns expected value' ); title = new Title({ - 'fontWeight': 'light' + 'fontWeight': 'lighter' }); - t.strictEqual( title.fontWeight, 'light', 'returns expected value' ); + t.strictEqual( title.fontWeight, 'lighter', 'returns expected value' ); title = new Title({ - 'fontWeight': 6 + 'fontWeight': '600' }); - t.strictEqual( title.fontWeight, 6, 'returns expected value' ); + t.strictEqual( title.fontWeight, '600', 'returns expected value' ); title = new Title({ - 'fontWeight': 8 + 'fontWeight': 800 }); - t.strictEqual( title.fontWeight, 8, 'returns expected value' ); + t.strictEqual( title.fontWeight, '800', 'returns expected value' ); t.end(); }); @@ -114,14 +116,14 @@ tape( 'the constructor returns an instance having a `fontWeight` property which title.fontWeight = 'bold'; t.strictEqual( title.fontWeight, 'bold', 'returns expected value' ); - title.fontWeight = 'light'; - t.strictEqual( title.fontWeight, 'light', 'returns expected value' ); + title.fontWeight = 'lighter'; + t.strictEqual( title.fontWeight, 'lighter', 'returns expected value' ); - title.fontWeight = 6; - t.strictEqual( title.fontWeight, 6, 'returns expected value' ); + title.fontWeight = '600'; + t.strictEqual( title.fontWeight, '600', 'returns expected value' ); - title.fontWeight = 8; - t.strictEqual( title.fontWeight, 8, 'returns expected value' ); + title.fontWeight = 800; + t.strictEqual( title.fontWeight, '800', 'returns expected value' ); t.end(); }); @@ -135,7 +137,7 @@ tape( 'the constructor returns an instance which emits an event when the `fontWe title.on( 'change', onChange ); - title.fontWeight = 'light'; + title.fontWeight = 'lighter'; t.strictEqual( count, 1, 'returns expected value' ); title.fontWeight = 'bold';