-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into cat17_noGoals
- Loading branch information
Showing
9 changed files
with
117 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
skins/cat17/src/app/tests/view_handlers/test_display_field_suboptions.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
'use strict'; | ||
|
||
var test = require( 'tape' ), | ||
sinon = require( 'sinon' ), | ||
SuboptionDisplayHandler = require( '../../lib/view_handler/display_field_suboptions' ) | ||
; | ||
|
||
test( 'Current field is selected and infotext opened, others unselected and not opened', function ( t ) { | ||
var allWrappers = { | ||
removeClass: sinon.spy() | ||
}, | ||
allInfoTexts = { | ||
removeClass: sinon.spy() | ||
}, | ||
activeInfoText = { | ||
addClass: sinon.spy(), | ||
prop: sinon.stub().withArgs( 'scrollHeight' ).returns( 472 ) | ||
}, | ||
activeWrapper = { | ||
find: sinon.stub().withArgs( '.info-text' ).returns( activeInfoText ), | ||
addClass: sinon.spy() | ||
}, | ||
activeField = { | ||
parents: sinon.stub().withArgs( '.wrap-field' ).returns( activeWrapper ) | ||
}, | ||
fieldset = { | ||
find: sinon.stub(), | ||
css: sinon.spy() | ||
} | ||
; | ||
|
||
fieldset.find.withArgs( '.wrap-field' ).returns( allWrappers ); | ||
fieldset.find.withArgs( '.info-text' ).returns( allInfoTexts ); | ||
fieldset.find.withArgs( '.wrap-input [value="PPL"]:not(.hidden)' ).returns( activeField ); | ||
|
||
var handler = SuboptionDisplayHandler.createSuboptionDisplayHandler( fieldset ); | ||
handler.update( 'PPL' ); | ||
|
||
t.ok( allWrappers.removeClass.withArgs( 'selected notselected' ).calledOnce, 'all wappers unstyled' ); | ||
t.ok( allInfoTexts.removeClass.withArgs( 'opened' ).calledOnce, 'all infotexts closed' ); | ||
|
||
t.ok( activeWrapper.addClass.withArgs( 'selected' ).calledOnce, 'active wrapper styled' ); | ||
t.ok( activeInfoText.addClass.withArgs( 'opened' ).calledOnce, 'active infotext opened' ); | ||
t.ok( fieldset.css.withArgs( 'min-height', '472px' ).calledOnce, 'height of fieldset adjusted per active infotext' ); | ||
|
||
t.end(); | ||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters