-
Notifications
You must be signed in to change notification settings - Fork 25
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 #100 from juwara0/mochaDeprecations
Updated deprecated method describeComponent
- Loading branch information
Showing
23 changed files
with
1,300 additions
and
1,334 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,55 @@ | ||
import {expect} from 'chai' | ||
import {describeComponent, it} from 'ember-mocha' | ||
import hbs from 'htmlbars-inline-precompile' | ||
import {describe, it} from 'mocha' | ||
import {registerMockComponent, unregisterMockComponent} from '../../helpers/mock-component' | ||
|
||
describeComponent( | ||
'frost-list-core', | ||
'Integration: FrostListCoreComponent', | ||
{ | ||
integration: true | ||
}, | ||
function () { | ||
it.skip('Header section renders when "sorting" is passed in', function () { | ||
registerMockComponent(this, 'mock-sort') | ||
|
||
this.render(hbs` | ||
{{frost-list-core | ||
sorting=(component 'mock-sort' class='mock-sort') | ||
}} | ||
`) | ||
|
||
expect( | ||
this.$('.frost-list-header'), | ||
'header section is rendered' | ||
).to.have.length(1) | ||
|
||
expect( | ||
this.$('.mock-sort'), | ||
'sort component is rendered' | ||
).to.have.length(1) | ||
|
||
unregisterMockComponent(this) | ||
}) | ||
|
||
it.skip('Header section renders when "expansion" is passed in', function () { | ||
registerMockComponent(this, 'mock-expansion') | ||
|
||
this.render(hbs` | ||
{{frost-list-core | ||
expansion=(component 'mock-expansion' class='mock-expansion') | ||
}} | ||
`) | ||
|
||
expect( | ||
this.$('.frost-list-header'), | ||
'header section is rendered' | ||
).to.have.length(1) | ||
|
||
expect( | ||
this.$('.mock-expansion'), | ||
'expansion component is rendered' | ||
).to.have.length(1) | ||
|
||
unregisterMockComponent(this) | ||
}) | ||
} | ||
) | ||
import {integration} from 'dummy/tests/helpers/ember-test-utils/setup-component-test' | ||
|
||
const test = integration('frost-list-core') | ||
describe.skip(test.label, function () { | ||
test.setup() | ||
|
||
it.skip('Header section renders when "sorting" is passed in', function () { | ||
registerMockComponent(this, 'mock-sort') | ||
|
||
this.render(hbs` | ||
{{frost-list-core | ||
sorting=(component 'mock-sort' class='mock-sort') | ||
}} | ||
`) | ||
|
||
expect( | ||
this.$('.frost-list-header'), | ||
'header section is rendered' | ||
).to.have.length(1) | ||
|
||
expect( | ||
this.$('.mock-sort'), | ||
'sort component is rendered' | ||
).to.have.length(1) | ||
|
||
unregisterMockComponent(this) | ||
}) | ||
|
||
it.skip('Header section renders when "expansion" is passed in', function () { | ||
registerMockComponent(this, 'mock-expansion') | ||
|
||
this.render(hbs` | ||
{{frost-list-core | ||
expansion=(component 'mock-expansion' class='mock-expansion') | ||
}} | ||
`) | ||
|
||
expect( | ||
this.$('.frost-list-header'), | ||
'header section is rendered' | ||
).to.have.length(1) | ||
|
||
expect( | ||
this.$('.mock-expansion'), | ||
'expansion component is rendered' | ||
).to.have.length(1) | ||
|
||
unregisterMockComponent(this) | ||
}) | ||
}) |
145 changes: 71 additions & 74 deletions
145
tests/integration/components/frost-list-expansion-test.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 |
---|---|---|
@@ -1,101 +1,98 @@ | ||
import {expect} from 'chai' | ||
import {$hook, initialize as initializeHook} from 'ember-hook' | ||
import {describeComponent, it} from 'ember-mocha' | ||
import hbs from 'htmlbars-inline-precompile' | ||
import {afterEach, beforeEach, describe} from 'mocha' | ||
import {afterEach, beforeEach, describe, it} from 'mocha' | ||
import sinon from 'sinon' | ||
|
||
describeComponent( | ||
'frost-list-expansion', | ||
'Integration: FrostListExpansionComponent', | ||
{ | ||
integration: true | ||
}, | ||
function () { | ||
let sandbox | ||
import {integration} from 'dummy/tests/helpers/ember-test-utils/setup-component-test' | ||
|
||
beforeEach(function () { | ||
initializeHook() | ||
sandbox = sinon.sandbox.create() | ||
}) | ||
const test = integration('frost-list-expansion') | ||
describe(test.label, function () { | ||
test.setup() | ||
|
||
afterEach(function () { | ||
sandbox.restore() | ||
}) | ||
let sandbox | ||
|
||
it.skip('renders with default class', function () { | ||
this.render(hbs` | ||
{{frost-list-expansion | ||
onCollapseAll='onCollapseAll' | ||
onExpandAll='onExpandAll' | ||
}} | ||
`) | ||
beforeEach(function () { | ||
initializeHook() | ||
sandbox = sinon.sandbox.create() | ||
}) | ||
|
||
expect( | ||
this.$('.frost-list-expansion') | ||
).to.be.length(1) | ||
}) | ||
afterEach(function () { | ||
sandbox.restore() | ||
}) | ||
|
||
it.skip('fires onCollapseAll closure action', function () { | ||
const collapseAllSpy = sandbox.spy() | ||
it.skip('renders with default class', function () { | ||
this.render(hbs` | ||
{{frost-list-expansion | ||
onCollapseAll='onCollapseAll' | ||
onExpandAll='onExpandAll' | ||
}} | ||
`) | ||
|
||
this.on('collapseAllAction', collapseAllSpy) | ||
expect( | ||
this.$('.frost-list-expansion') | ||
).to.be.length(1) | ||
}) | ||
|
||
this.render(hbs` | ||
{{frost-list-expansion | ||
onCollapseAll=(action 'collapseAllAction') | ||
onExpandAll='onExpandAll' | ||
}} | ||
`) | ||
it.skip('fires onCollapseAll closure action', function () { | ||
const collapseAllSpy = sandbox.spy() | ||
|
||
this.$($hook('-collapse-all')).trigger('click') | ||
this.on('collapseAllAction', collapseAllSpy) | ||
|
||
expect( | ||
collapseAllSpy.called | ||
).to.eql(true) | ||
}) | ||
this.render(hbs` | ||
{{frost-list-expansion | ||
onCollapseAll=(action 'collapseAllAction') | ||
onExpandAll='onExpandAll' | ||
}} | ||
`) | ||
|
||
this.$($hook('-collapse-all')).trigger('click') | ||
|
||
expect( | ||
collapseAllSpy.called | ||
).to.eql(true) | ||
}) | ||
|
||
it.skip('fires onExpandAll closure action', function () { | ||
const expandAllSpy = sandbox.spy() | ||
|
||
it.skip('fires onExpandAll closure action', function () { | ||
const expandAllSpy = sandbox.spy() | ||
this.on('expandAllAction', expandAllSpy) | ||
|
||
this.on('expandAllAction', expandAllSpy) | ||
this.render(hbs` | ||
{{frost-list-expansion | ||
onCollapseAll='onCollapseAll' | ||
onExpandAll=(action 'expandAllAction') | ||
}} | ||
`) | ||
|
||
this.$($hook('-expand-all')).trigger('click') | ||
|
||
expect( | ||
expandAllSpy.called | ||
).to.eql(true) | ||
}) | ||
|
||
describe.skip('concatenates the hook property', function () { | ||
beforeEach(function () { | ||
this.render(hbs` | ||
{{frost-list-expansion | ||
hook='my-list' | ||
onCollapseAll='onCollapseAll' | ||
onExpandAll=(action 'expandAllAction') | ||
onExpandAll='onExpandAll' | ||
}} | ||
`) | ||
}) | ||
|
||
this.$($hook('-expand-all')).trigger('click') | ||
|
||
it('sets -collapse-all hook correctly', function () { | ||
expect( | ||
expandAllSpy.called | ||
).to.eql(true) | ||
$hook('my-list-collapse-all').text().trim() | ||
).to.equal('Collapse all') | ||
}) | ||
|
||
describe.skip('concatenates the hook property', function () { | ||
beforeEach(function () { | ||
this.render(hbs` | ||
{{frost-list-expansion | ||
hook='my-list' | ||
onCollapseAll='onCollapseAll' | ||
onExpandAll='onExpandAll' | ||
}} | ||
`) | ||
}) | ||
|
||
it('sets -collapse-all hook correctly', function () { | ||
expect( | ||
$hook('my-list-collapse-all').text().trim() | ||
).to.equal('Collapse all') | ||
}) | ||
|
||
it('sets -expand-all hook correctly', function () { | ||
expect( | ||
$hook('my-list-expand-all').text().trim() | ||
).to.equal('Expand all') | ||
}) | ||
it('sets -expand-all hook correctly', function () { | ||
expect( | ||
$hook('my-list-expand-all').text().trim() | ||
).to.equal('Expand all') | ||
}) | ||
} | ||
) | ||
}) | ||
}) |
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
Oops, something went wrong.