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

Tests/onAttach, onDomRefresh, onDomRemove, and precompiled template #3533

Conversation

wesmangum
Copy link
Contributor

Proposed changes

  • Reorganize tests to match order of codebase
  • Import dependencies to move away from using global ones
  • Use let in favor of this in beforeEach

Link to the issue: #3248

This pr is a small part of the work to refactor the whole unit tests directory. Merging this issue should keep #3248 open

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling f37d4da on wesmangum:tests/onAttach-onDomRefresh-onDomRemove-templateRenderer into 91ab7ea on marionettejs:next.

let regionEl;
let region; // A Region to show our View within

beforeEach(function() {
sinon = this.sinon;
View = Marionette.View.extend(extendAttachMethods(Marionette.View)({
testView = View.extend(extendAttachMethods(View)({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TestView ?

beforeEach(function() {
this.bbView = new this.MnView();
this.attachedRegion.show(this.bbView);
bbView = new MnView();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems the test was already wrong. It should be new BbView

this.View = Backbone.Marionette.View.extend({
template: _.template(this.template)
template = 'foobar';
testView = View.extend({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TestView

@wesmangum wesmangum force-pushed the tests/onAttach-onDomRefresh-onDomRemove-templateRenderer branch from f37d4da to b4ed1b7 Compare November 10, 2017 15:28
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling b4ed1b7 on wesmangum:tests/onAttach-onDomRefresh-onDomRemove-templateRenderer into 91ab7ea on marionettejs:next.

@@ -1,61 +1,80 @@
import _ from 'underscore';
import Backbone from 'backbone';
import Marionette from '../../src/backbone.marionette';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should be able to remove this import entirely

@@ -1,76 +1,95 @@
import _ from 'underscore';
import Backbone from 'backbone';
import Marionette from '../../src/backbone.marionette';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

@wesmangum wesmangum force-pushed the tests/onAttach-onDomRefresh-onDomRemove-templateRenderer branch from b4ed1b7 to c33a923 Compare November 13, 2017 19:57
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling c33a923 on wesmangum:tests/onAttach-onDomRefresh-onDomRemove-templateRenderer into 7761081 on marionettejs:next.

beforeEach(function() {
this.bbView = new this.MnView();
this.attachedRegion.show(this.bbView);
bbView = new MnView();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is incorrect. it should be new BbView()

@wesmangum wesmangum force-pushed the tests/onAttach-onDomRefresh-onDomRemove-templateRenderer branch from c33a923 to 4e8c983 Compare November 16, 2017 16:27
@wesmangum wesmangum force-pushed the tests/onAttach-onDomRefresh-onDomRemove-templateRenderer branch from 4e8c983 to b1885f5 Compare November 16, 2017 16:28
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling b1885f5 on wesmangum:tests/onAttach-onDomRefresh-onDomRemove-templateRenderer into 5813ed2 on marionettejs:next.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling b1885f5 on wesmangum:tests/onAttach-onDomRefresh-onDomRemove-templateRenderer into 5813ed2 on marionettejs:next.

@paulfalgout paulfalgout merged commit 37a9dc1 into marionettejs:next Nov 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants