Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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' );

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

values = [
'Arial',
'foo',
5,
NaN,
null,
Expand Down Expand Up @@ -82,26 +84,26 @@ 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();
});

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();
});
Expand All @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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' );


Expand All @@ -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();
});
Expand All @@ -61,6 +60,9 @@ tape( 'the constructor returns an instance having a `fontWeight` property which
var i;

values = [
'foo',
6,
NaN,
null,
true,
false,
Expand Down Expand Up @@ -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();
});
Expand All @@ -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();
});
Expand All @@ -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';
Expand Down
Loading