Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Tests: Adjusted tests to the new color palette.
Browse files Browse the repository at this point in the history
  • Loading branch information
oleq committed Feb 19, 2018
1 parent 8af9a6b commit 870c78c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
11 changes: 6 additions & 5 deletions tests/highlightediting.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,12 @@ describe( 'HighlightEditing', () => {
it( 'should be set', () => {
expect( editor.config.get( 'highlight' ) ).to.deep.equal( {
options: [
{ model: 'marker', class: 'marker', title: 'Marker', color: '#ffff66', type: 'marker' },
{ model: 'greenMarker', class: 'marker-green', title: 'Green marker', color: '#66ff00', type: 'marker' },
{ model: 'pinkMarker', class: 'marker-pink', title: 'Pink marker', color: '#ff6fff', type: 'marker' },
{ model: 'redPen', class: 'pen-red', title: 'Red pen', color: '#ff2929', type: 'pen' },
{ model: 'bluePen', class: 'pen-blue', title: 'Blue pen', color: '#0091ff', type: 'pen' }
{ model: 'marker', class: 'marker', title: 'Marker', color: '#fdfd77', type: 'marker' },
{ model: 'greenMarker', class: 'marker-green', title: 'Green marker', color: '#63f963', type: 'marker' },
{ model: 'pinkMarker', class: 'marker-pink', title: 'Pink marker', color: '#fc7999', type: 'marker' },
{ model: 'blueMarker', class: 'marker-blue', title: 'Blue marker', color: '#72cdfd', type: 'marker' },
{ model: 'redPen', class: 'pen-red', title: 'Red pen', color: '#e91313', type: 'pen' },
{ model: 'greenPen', class: 'pen-green', title: 'Green pen', color: '#118800', type: 'pen' }
]
} );
} );
Expand Down
22 changes: 12 additions & 10 deletions tests/highlightui.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ describe( 'HighlightUI', () => {
'Marker': 'Marker',
'Green marker': 'Zielony marker',
'Pink marker': 'Różowy marker',
'Blue marker': 'Niebieski marker',
'Red pen': 'Czerwony długopis',
'Blue pen': 'Niebieski długopis',
'Green pen': 'Zielony długopis',
'Remove highlighting': 'Usuń zaznaczenie'
} );
} );
Expand Down Expand Up @@ -88,7 +89,7 @@ describe( 'HighlightUI', () => {
expect( dropdown.buttonView.element.classList.contains( 'ck-highlight-button' ) ).to.be.true;
// There should be 5 highlight buttons, one separator and highlight remove button in toolbar.
expect( dropdown.toolbarView.items.map( button => button.element.classList.contains( 'ck-highlight-button' ) ) )
.to.deep.equal( [ true, true, true, true, true, false, false ] );
.to.deep.equal( [ true, true, true, true, true, true, false, false ] );
} );

it( 'should have proper icons in dropdown', () => {
Expand All @@ -98,7 +99,7 @@ describe( 'HighlightUI', () => {
command.value = undefined;

expect( toolbar.items.map( item => item.icon ) )
.to.deep.equal( [ markerIcon, markerIcon, markerIcon, penIcon, penIcon, undefined, eraserIcon ] );
.to.deep.equal( [ markerIcon, markerIcon, markerIcon, markerIcon, penIcon, penIcon, undefined, eraserIcon ] );
} );

it( 'should activate current option in dropdown', () => {
Expand All @@ -108,13 +109,13 @@ describe( 'HighlightUI', () => {
command.value = undefined;

expect( toolbar.items.map( item => item.isOn ) )
.to.deep.equal( [ false, false, false, false, false, undefined, false ] );
.to.deep.equal( [ false, false, false, false, false, false, undefined, false ] );

// Inside a selection with highlight.
command.value = 'greenMarker';

// The second item is 'greenMarker' highlighter.
expect( toolbar.items.map( item => item.isOn ) ).to.deep.equal( [ false, true, false, false, false, undefined, false ] );
expect( toolbar.items.map( item => item.isOn ) ).to.deep.equal( [ false, true, false, false, false, false, undefined, false ] );
} );

describe( 'toolbar button behavior', () => {
Expand All @@ -138,7 +139,7 @@ describe( 'HighlightUI', () => {
it( 'should change button on selection', () => {
command.value = 'redPen';

validateButton( 3 );
validateButton( 4 );

command.value = undefined;

Expand All @@ -149,13 +150,13 @@ describe( 'HighlightUI', () => {
command.value = 'marker';
validateButton( 0 );

buttons[ 4 ].fire( 'execute' );
command.value = 'bluePen';
buttons[ 5 ].fire( 'execute' );
command.value = 'greenPen';

// Simulate selection moved to not highlighted text.
command.value = undefined;

validateButton( 4 );
validateButton( 5 );
} );

it( 'should focus view after command execution', () => {
Expand Down Expand Up @@ -197,8 +198,9 @@ describe( 'HighlightUI', () => {
'Marker',
'Zielony marker',
'Różowy marker',
'Niebieski marker',
'Czerwony długopis',
'Niebieski długopis',
'Zielony długopis',
'Usuń zaznaczenie'
] );
} );
Expand Down

0 comments on commit 870c78c

Please sign in to comment.