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

Correctly start modules when they are defined on a container #98

Merged
merged 1 commit into from Nov 13, 2015

Conversation

@fofr
Copy link
Contributor

@fofr fofr commented Nov 11, 2015

The tests contained a deficiency that was revealed when porting them to govuk_frontend_toolkit. The existing module assertions used toMatch on HTML objects which gave false positives because of shallow comparisons.

Instead assert that the jQuery object containers the HTML we expect.

This unveiled a failing test which has also been fixed. When the data-module was passed in on a container to the start method, that module wouldn't be correctly started. Instead of using push the jQuery collection needs to be manipulated with add.

The tests contain a deficiency that was revealed when porting them to
govuk_frontend_toolkit. The existing module assertions use `toMatch` on
HTML objects which gives a false positive.

Instead assert that the HTML we expect is within the jQuery object.

This unveiled a failing test which has also been fixed. The `push`
method for when a container is also a module should actually be `add`.
@fofr fofr changed the title Correctly start modules when they are defined on a container that's passed in Correctly start modules when they are defined on a container Nov 11, 2015
dsingleton added a commit that referenced this issue Nov 13, 2015
Correctly start modules when they are defined on a container
@dsingleton dsingleton merged commit 7a4e8d2 into master Nov 13, 2015
1 check passed
@dsingleton dsingleton deleted the fix-module-find-tests branch Nov 13, 2015
fofr added a commit that referenced this issue Nov 13, 2015
* Fix module starting when the module is defined on the container
passed into `GOVUKAdmin.start`
#98
@fofr fofr mentioned this pull request Nov 13, 2015
fofr added a commit that referenced this issue Nov 25, 2015
* Fix module starting when the module is defined on the container
passed into `GOVUKAdmin.start`
#98
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants