Skip to content

Commit

Permalink
Merge pull request #100 from juwara0/mochaDeprecations
Browse files Browse the repository at this point in the history
Updated deprecated method describeComponent
  • Loading branch information
juwara0 committed Feb 7, 2017
2 parents 6ef653a + 7449b41 commit 9c4caf1
Show file tree
Hide file tree
Showing 23 changed files with 1,300 additions and 1,334 deletions.
104 changes: 51 additions & 53 deletions tests/integration/components/frost-list-core-test.js
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 tests/integration/components/frost-list-expansion-test.js
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')
})
}
)
})
})
10 changes: 6 additions & 4 deletions tests/integration/components/frost-list-item-expansion-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@
*/

// import {expect} from 'chai'
// import {describeComponent, it} from 'ember-mocha'
// import hbs from 'htmlbars-inline-precompile'
// import {$hook, initialize as initializeHook} from 'ember-hook'
// import wait from 'ember-test-helpers/wait'
// import {afterEach, beforeEach, describe} from 'mocha'
// import {afterEach, beforeEach, describe, it} from 'mocha'
// import sinon from 'sinon'

// import {integration} from 'ember-frost-list/tests/helpers/ember-test-utils/describe-component'
// import {integration} from 'dummy/tests/helpers/ember-test-utils/setup-component-test'

// const test = integration('frost-list-item-expansion')
// describe(test.label, function () {
// test.setup()

// describeComponent(...integration('frost-list-item-expansion'), function () {
// let sandbox

// beforeEach(function () {
Expand Down
10 changes: 6 additions & 4 deletions tests/integration/components/frost-list-item-selection-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@
*/

// import {expect} from 'chai'
// import {describeComponent, it} from 'ember-mocha'
// import hbs from 'htmlbars-inline-precompile'
// import {$hook, initialize as initializeHook} from 'ember-hook'
// import wait from 'ember-test-helpers/wait'
// import {afterEach, beforeEach, describe} from 'mocha'
// import {afterEach, beforeEach, describe, it} from 'mocha'
// import sinon from 'sinon'

// import {integration} from 'ember-frost-list/tests/helpers/ember-test-utils/describe-component'
// import {integration} from 'dummy/tests/helpers/ember-test-utils/setup-component-test'

// const test = integration('frost-list-item-selection')
// describe(test.label, function () {
// test.setup()

// describeComponent(...integration('frost-list-item-selection'), function () {
// let sandbox

// beforeEach(function () {
Expand Down
Loading

0 comments on commit 9c4caf1

Please sign in to comment.