-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #193 from juwara0/mochaDeprecations
update usage of deprecated describeComponent and describeModule methods
- Loading branch information
Showing
15 changed files
with
378 additions
and
465 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,34 @@ | ||
import { expect } from 'chai' | ||
import { $hook, initialize } from 'ember-hook' | ||
import {expect} from 'chai' | ||
import {$hook, initialize} from 'ember-hook' | ||
import sinon from 'sinon' | ||
import { | ||
describeComponent, | ||
it | ||
} from 'ember-mocha' | ||
import { beforeEach } from 'mocha' | ||
import hbs from 'htmlbars-inline-precompile' | ||
import {beforeEach, describe, it} from 'mocha' | ||
|
||
describeComponent( | ||
'nav-action', | ||
'Integration: NavActionComponent', | ||
{ | ||
integration: true | ||
}, | ||
function () { | ||
beforeEach(function () { | ||
initialize() | ||
}) | ||
it('renders', function () { | ||
this.render(hbs`{{nav-action}}`) | ||
expect(this.$()).to.have.length(1) | ||
}) | ||
it('calls perform action', function () { | ||
let nav = Ember.Object.create({ | ||
performAction: sinon.spy() | ||
}) | ||
this.set('_nav', nav) | ||
this.set('_item', 'test') | ||
this.render(hbs`{{nav-action | ||
frostNavigation=_nav | ||
item=_item | ||
hook='nav-action' | ||
}}`) | ||
$hook('nav-action').click() | ||
expect(nav.performAction.called).to.be.true | ||
import {integration} from 'dummy/tests/helpers/ember-test-utils/setup-component-test' | ||
|
||
const test = integration('nav-action') | ||
describe(test.label, function () { | ||
test.setup() | ||
|
||
beforeEach(function () { | ||
initialize() | ||
}) | ||
it('renders', function () { | ||
this.render(hbs`{{nav-action}}`) | ||
expect(this.$()).to.have.length(1) | ||
}) | ||
it('calls perform action', function () { | ||
let nav = Ember.Object.create({ | ||
performAction: sinon.spy() | ||
}) | ||
} | ||
) | ||
this.set('_nav', nav) | ||
this.set('_item', 'test') | ||
this.render(hbs`{{nav-action | ||
frostNavigation=_nav | ||
item=_item | ||
hook='nav-action' | ||
}}`) | ||
$hook('nav-action').click() | ||
expect(nav.performAction.called).to.be.true | ||
}) | ||
}) |
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 |
---|---|---|
@@ -1,53 +1,45 @@ | ||
import { expect } from 'chai' | ||
import { $hook, initialize } from 'ember-hook' | ||
import { | ||
describeComponent, | ||
it | ||
} from 'ember-mocha' | ||
import { | ||
describe, | ||
beforeEach | ||
} from 'mocha' | ||
import {expect} from 'chai' | ||
import {$hook, initialize} from 'ember-hook' | ||
import hbs from 'htmlbars-inline-precompile' | ||
describeComponent( | ||
'nav-category', | ||
'Integration: NavCategoryComponent', | ||
{ | ||
integration: true | ||
}, | ||
function () { | ||
beforeEach(function () { | ||
initialize() | ||
import {beforeEach, describe, it} from 'mocha' | ||
|
||
import {integration} from 'dummy/tests/helpers/ember-test-utils/setup-component-test' | ||
|
||
const test = integration('nav-category') | ||
describe(test.label, function () { | ||
test.setup() | ||
|
||
beforeEach(function () { | ||
initialize() | ||
}) | ||
it('renders', function () { | ||
this.render(hbs`{{nav-category}}`) | ||
expect(this.$()).to.have.length(1) | ||
}) | ||
describe('clicks', function () { | ||
const helper = function (name, _activeCategory) { | ||
this.set('_name', name) | ||
this.set('_nav', Ember.Object.create({ | ||
_activeCategory, | ||
dismiss () { | ||
this.set('_activeCategory', null) | ||
} | ||
})) | ||
this.render(hbs`{{nav-category | ||
name=_name | ||
frostNavigation=_nav | ||
hook='nav-category' | ||
}}`) | ||
$hook('nav-category').click() | ||
} | ||
it('handles null case', function () { | ||
helper.call(this, 'test', null) | ||
}) | ||
it('renders', function () { | ||
this.render(hbs`{{nav-category}}`) | ||
expect(this.$()).to.have.length(1) | ||
it('handles not equal case', function () { | ||
helper.call(this, 'test', '_test') | ||
}) | ||
describe('clicks', function () { | ||
const helper = function (name, _activeCategory) { | ||
this.set('_name', name) | ||
this.set('_nav', Ember.Object.create({ | ||
_activeCategory, | ||
dismiss () { | ||
this.set('_activeCategory', null) | ||
} | ||
})) | ||
this.render(hbs`{{nav-category | ||
name=_name | ||
frostNavigation=_nav | ||
hook='nav-category' | ||
}}`) | ||
$hook('nav-category').click() | ||
} | ||
it('handles null case', function () { | ||
helper.call(this, 'test', null) | ||
}) | ||
it('handles not equal case', function () { | ||
helper.call(this, 'test', '_test') | ||
}) | ||
it('handles equal case', function () { | ||
helper.call(this, 'test', 'test') | ||
}) | ||
it('handles equal case', function () { | ||
helper.call(this, 'test', 'test') | ||
}) | ||
} | ||
) | ||
}) | ||
}) |
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 |
---|---|---|
@@ -1,30 +1,25 @@ | ||
/* jshint expr:true */ | ||
import { expect } from 'chai' | ||
import { | ||
describeComponent, | ||
it | ||
} from 'ember-mocha' | ||
import {expect} from 'chai' | ||
import hbs from 'htmlbars-inline-precompile' | ||
import {describe, it} from 'mocha' | ||
|
||
describeComponent( | ||
'nav-modal-outlet', | ||
'Integration: NavModalOutletComponent', | ||
{ | ||
integration: true | ||
}, | ||
function () { | ||
it('renders', function () { | ||
// Set any properties with set(this, 'myProperty', 'value'); | ||
// Handle any actions with this.on('myAction', function(val) { ... }); | ||
// Template block usage: | ||
// this.render(hbs` | ||
// {{#nav-modal-outlet}} | ||
// template content | ||
// {{/nav-modal-outlet}} | ||
// `); | ||
import {integration} from 'dummy/tests/helpers/ember-test-utils/setup-component-test' | ||
|
||
this.render(hbs`{{nav-modal-outlet}}`) | ||
expect(this.$()).to.have.length(1) | ||
}) | ||
} | ||
) | ||
const test = integration('nav-modal-outlet') | ||
describe(test.label, function () { | ||
test.setup() | ||
|
||
it('renders', function () { | ||
// Set any properties with set(this, 'myProperty', 'value'); | ||
// Handle any actions with this.on('myAction', function(val) { ... }); | ||
// Template block usage: | ||
// this.render(hbs` | ||
// {{#nav-modal-outlet}} | ||
// template content | ||
// {{/nav-modal-outlet}} | ||
// `); | ||
|
||
this.render(hbs`{{nav-modal-outlet}}`) | ||
expect(this.$()).to.have.length(1) | ||
}) | ||
}) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,41 @@ | ||
import { expect } from 'chai' | ||
import { $hook, initialize } from 'ember-hook' | ||
|
||
import {expect} from 'chai' | ||
import Ember from 'ember' | ||
import {$hook, initialize} from 'ember-hook' | ||
import hbs from 'htmlbars-inline-precompile' | ||
import {beforeEach, describe, it} from 'mocha' | ||
import sinon from 'sinon' | ||
|
||
import { | ||
describeComponent, | ||
it | ||
} from 'ember-mocha' | ||
import { beforeEach } from 'mocha' | ||
import hbs from 'htmlbars-inline-precompile' | ||
import Ember from 'ember' | ||
import {integration} from 'dummy/tests/helpers/ember-test-utils/setup-component-test' | ||
|
||
describeComponent( | ||
'nav-route', | ||
'Integration: NavRouteComponent', | ||
{ | ||
integration: true | ||
}, | ||
function () { | ||
beforeEach(function () { | ||
initialize() | ||
}) | ||
it('renders', function () { | ||
this.render(hbs`{{nav-route}}`) | ||
expect(this.$()).to.have.length(1) | ||
}) | ||
it('handles click, and dismiss', function () { | ||
let nav = Ember.Object.create({ | ||
dismiss: sinon.spy(), | ||
transitionTo: sinon.spy() | ||
}) | ||
this.set('_nav', nav) | ||
this.render(hbs`{{nav-route | ||
frostNavigation=_nav | ||
route='test' | ||
hook='nav-route' | ||
}}`) | ||
const e = (o) => Ember.$.Event('click', o) | ||
;[ | ||
e({shiftKey: true}), | ||
e({metaKey: true}), | ||
e({ctrlKey: true}), | ||
e() | ||
].forEach(e => $hook('nav-route').trigger(e)) | ||
expect(nav.dismiss.calledThrice).to.be.true | ||
const test = integration('nav-route') | ||
describe(test.label, function () { | ||
test.setup() | ||
|
||
beforeEach(function () { | ||
initialize() | ||
}) | ||
it('renders', function () { | ||
this.render(hbs`{{nav-route}}`) | ||
expect(this.$()).to.have.length(1) | ||
}) | ||
it('handles click, and dismiss', function () { | ||
let nav = Ember.Object.create({ | ||
dismiss: sinon.spy(), | ||
transitionTo: sinon.spy() | ||
}) | ||
} | ||
) | ||
this.set('_nav', nav) | ||
this.render(hbs`{{nav-route | ||
frostNavigation=_nav | ||
route='test' | ||
hook='nav-route' | ||
}}`) | ||
const e = (o) => Ember.$.Event('click', o) | ||
;[ | ||
e({shiftKey: true}), | ||
e({metaKey: true}), | ||
e({ctrlKey: true}), | ||
e() | ||
].forEach(e => $hook('nav-route').trigger(e)) | ||
expect(nav.dismiss.calledThrice).to.be.true | ||
}) | ||
}) |
Oops, something went wrong.