Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

T/140 - Controller.issues undefined before Controller.check callback. #211

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
8 changes: 6 additions & 2 deletions Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ define( [
'ui/Ui',
'ui/ViewerController',
'HotkeyManager',
'Localization'
'Localization',
'IssueList'
], function(
CheckingMode,
ListeningMode,
Expand All @@ -22,7 +23,8 @@ define( [
Ui,
ViewerController,
HotkeyManager,
Localization
Localization,
IssueList
) {
'use strict';

Expand Down Expand Up @@ -289,6 +291,8 @@ define( [
that._engineProcessed.call( that, issueList, options );
};

this.issues = new IssueList();

this.engine.process( this, scratchpad, completeCallback );
};

Expand Down
16 changes: 14 additions & 2 deletions tests/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@
'mock/ControllerMockup',
'Controller/CheckingMode',
'mocking',
'Localization'
'Localization',
'IssueList'
], function(
Controller,
ControllerMockup,
CheckingMode,
mocking,
Localization
Localization,
IssueList
) {
bender.test( {
setUp: function() {
Expand Down Expand Up @@ -125,6 +127,16 @@
mocking.assert.calledWith( options.callback, false, listMock );
},

'test Controller.check before callback': function() {
patchMockupForExecMethod( this.mockup );

this.mockup.check( {
callback: function() {}
} );

assert.isTrue( this.mockup.issues instanceof IssueList );
},

'test Controller.check gui featured call': function() {
patchMockupForCheckMethod( this.mockup );

Expand Down