From aee8f7d455cf093f5542e3c3bf71f022bc90af44 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Wed, 24 Jan 2018 11:17:42 -0600 Subject: [PATCH 01/25] ignoring of package-lock until we are ready to move to node 8 --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index a5fdf51..e7b5091 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ /coverage/* /libpeerconnection.log npm-debug.log* +package-lock.json testem.log .idea coverage.json From e19f41ee9435fd6d79401c90b62106d1b9e843de Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Wed, 24 Jan 2018 11:18:33 -0600 Subject: [PATCH 02/25] ignore the linting of the CHANGELOG.md --- .remarkignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .remarkignore diff --git a/.remarkignore b/.remarkignore new file mode 100644 index 0000000..1b763b1 --- /dev/null +++ b/.remarkignore @@ -0,0 +1 @@ +CHANGELOG.md From 7449dc2755f10c84e840ae5f6f0c62c00ca1e7e2 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Wed, 24 Jan 2018 11:36:14 -0600 Subject: [PATCH 03/25] update ember-frost-test to ^4.0.0 and run generator to install testing packages --- package.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 1d1c477..a881ee4 100644 --- a/package.json +++ b/package.json @@ -34,12 +34,12 @@ "chai-jquery": "^2.0.0", "ember-async-image": "0.1.1", "ember-cli": "2.12.3", - "ember-cli-chai": "0.3.2", + "ember-cli-chai": "0.4.3", "ember-cli-code-coverage": "0.3.5", "ember-cli-dependency-checker": "^1.3.0", "ember-cli-htmlbars-inline-precompile": "0.3.12", "ember-cli-inject-live-reload": "^1.4.1", - "ember-cli-mocha": "0.13.2", + "ember-cli-mocha": "0.14.4", "ember-cli-notifications": "^4.0.1", "ember-cli-shims": "^1.0.2", "ember-cli-uglify": "^1.2.0", @@ -49,16 +49,16 @@ "ember-disable-prototype-extensions": "^1.1.0", "ember-export-application-global": "^1.0.5", "ember-frost-sort": "^9.0.0", - "ember-frost-test": "1.0.1", + "ember-frost-test": "^4.0.0", "ember-load-initializers": "^0.6.0", "ember-resolver": "^2.0.3", - "ember-sinon": "0.6.0", + "ember-sinon": "^0.7.0", "ember-source": "~2.12.0", - "ember-test-utils": "^5.1.1", + "ember-test-utils": "^8.1.0", "loader.js": "^4.2.3", "pr-bumper": "^1.11.0", "pull-report": "^0.3.1", - "sinon-chai": "^2.8.0" + "sinon-chai": "^2.14.0" }, "keywords": [ "ember-addon", @@ -70,7 +70,7 @@ "ember-cli-sass": "5.6.0", "ember-computed-decorators": "0.3.0", "ember-frost-core": "^4.0.1", - "ember-hook": "^1.4.2", + "ember-hook": "1.4.2", "ember-math-helpers": "2.0.6", "ember-prop-types": "^5.0.2", "ember-truth-helpers": "1.3.0", @@ -86,4 +86,4 @@ "pr-bumper": { "coverage": 97.22 } -} \ No newline at end of file +} From f2ddbdb7c346e05a0f1de8dbca25c90fce792b44 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Wed, 24 Jan 2018 12:14:51 -0600 Subject: [PATCH 04/25] fix linting errors --- addon/components/frost-list-item.js | 3 +- addon/components/frost-list.js | 6 +- addon/utils/selection.js | 2 + ember-cli-build.js | 2 +- index.js | 2 + testem.js | 2 +- tests/dummy/app/models/list-item.js | 9 +- tests/dummy/config/environment.js | 2 +- tests/dummy/config/scenarios.js | 2 +- .../frost-list-content-container-test.js | 4 +- .../components/frost-list-expansion-test.js | 10 +- .../frost-list-item-content-test.js | 10 +- .../frost-list-item-expansion-test.js | 12 +- .../frost-list-item-selection-test.js | 14 +- .../components/frost-list-item-test.js | 10 +- .../components/frost-list-pagination-test.js | 50 ++-- .../integration/components/frost-list-test.js | 246 +++++++++--------- tests/unit/helpers/floor-test.js | 4 +- tests/unit/helpers/is-lead-selection.js | 2 +- tests/unit/utils/selection-test.js | 6 +- 20 files changed, 200 insertions(+), 198 deletions(-) diff --git a/addon/components/frost-list-item.js b/addon/components/frost-list-item.js index 079ed63..c0b4053 100644 --- a/addon/components/frost-list-item.js +++ b/addon/components/frost-list-item.js @@ -43,7 +43,8 @@ export default Component.extend({ click (event) { // Acceptable event modifiers - const isSpecificSelect = (new window.UAParser()).getOS().name === 'Mac OS' ? event.metaKey : event.ctrlKey // TODO Move instance to a service + // TODO Move instance to a service + const isSpecificSelect = (new window.UAParser()).getOS().name === 'Mac OS' ? event.metaKey : event.ctrlKey const isRangeSelect = event.shiftKey // Only process simple clicks or clicks with the acceptable modifiers diff --git a/addon/components/frost-list.js b/addon/components/frost-list.js index 942a9db..0c96f31 100644 --- a/addon/components/frost-list.js +++ b/addon/components/frost-list.js @@ -4,15 +4,13 @@ import Ember from 'ember' const {$, A, ObjectProxy, String: EmberString, get, isEmpty, isNone, isPresent, run, set} = Ember +import layout from '../templates/components/frost-list' +import getComponentName from '../utils/get-component-name' import computed, {readOnly} from 'ember-computed-decorators' import {Component} from 'ember-frost-core' import {selection} from 'ember-frost-list' import {PropTypes} from 'ember-prop-types' -import layout from '../templates/components/frost-list' - -import getComponentName from '../utils/get-component-name' - export default Component.extend({ // == Dependencies ========================================================== diff --git a/addon/utils/selection.js b/addon/utils/selection.js index df2dfcd..4d3d22b 100644 --- a/addon/utils/selection.js +++ b/addon/utils/selection.js @@ -168,6 +168,7 @@ export default { * @param {Function} compareFct the compare function * @returns {Number} the index of the rhs value if it's in the array otherwise -1 */ + /* eslint-disable complexity */ _findIndex (array, rhs, compareFct) { if (this.isSupportedInEnvironment(array, 'findIndex')) { return array.findIndex(currentItem => compareFct(currentItem, rhs)) @@ -185,4 +186,5 @@ export default { return findIndex } } + /* eslint-enable complexity */ } diff --git a/ember-cli-build.js b/ember-cli-build.js index f8dda80..98a63fa 100644 --- a/ember-cli-build.js +++ b/ember-cli-build.js @@ -2,7 +2,7 @@ const EmberAddon = require('ember-cli/lib/broccoli/ember-addon') module.exports = function (defaults) { - var app = new EmberAddon(defaults, { + let app = new EmberAddon(defaults, { 'ember-cli-mocha': { useLintTree: false }, diff --git a/index.js b/index.js index 92f41c2..53bc095 100644 --- a/index.js +++ b/index.js @@ -20,6 +20,7 @@ module.exports = { } }, + /* eslint-disable complexity */ init: function (app) { this.options = this.options || {} this.options.babel = this.options.babel || {} @@ -33,4 +34,5 @@ module.exports = { this._super.init && this._super.init.apply(this, arguments) /* eslint-enable no-unused-expressions */ } + /* eslint-enable complexity */ } diff --git a/testem.js b/testem.js index ce6c0f9..175fb56 100644 --- a/testem.js +++ b/testem.js @@ -1,6 +1,6 @@ /* eslint-env node */ -var Reporter = require('ember-test-utils/reporter') +const Reporter = require('ember-test-utils/reporter') module.exports = { disable_watching: true, diff --git a/tests/dummy/app/models/list-item.js b/tests/dummy/app/models/list-item.js index 7b7bae3..729db00 100644 --- a/tests/dummy/app/models/list-item.js +++ b/tests/dummy/app/models/list-item.js @@ -1,8 +1,7 @@ import DS from 'ember-data' +const {Model, attr} = DS -var Model = DS.Model.extend({ - label: DS.attr('string'), - itemType: DS.attr('string') // Cannot use 'type' because it is a reserved word +export default Model.extend({ + label: attr('string'), + itemType: attr('string') // Cannot use 'type' because it is a reserved word }) - -export default Model diff --git a/tests/dummy/config/environment.js b/tests/dummy/config/environment.js index f1be561..b4e5fc7 100644 --- a/tests/dummy/config/environment.js +++ b/tests/dummy/config/environment.js @@ -1,7 +1,7 @@ /* eslint-env node */ module.exports = function (environment) { - var ENV = { + let ENV = { modulePrefix: 'dummy', podModulePrefix: 'dummy/pods', environment: environment, diff --git a/tests/dummy/config/scenarios.js b/tests/dummy/config/scenarios.js index 2243025..569e31f 100644 --- a/tests/dummy/config/scenarios.js +++ b/tests/dummy/config/scenarios.js @@ -1,4 +1,4 @@ import Main from '../scenarios/main' -var main = new Main() +const main = new Main() main() diff --git a/tests/integration/components/frost-list-content-container-test.js b/tests/integration/components/frost-list-content-container-test.js index c028ed5..e32bd80 100644 --- a/tests/integration/components/frost-list-content-container-test.js +++ b/tests/integration/components/frost-list-content-container-test.js @@ -3,8 +3,8 @@ */ import {expect} from 'chai' -const {A} = Ember import Ember from 'ember' +const {A} = Ember import {$hook, initialize as initializeHook} from 'ember-hook' import {registerMockComponent, unregisterMockComponent} from 'ember-test-utils/test-support/mock-component' import {integration} from 'ember-test-utils/test-support/setup-component-test' @@ -45,7 +45,7 @@ describe(test.label, function () { `) }) - it('has one vertical item created', function () { + it('should have one vertical item created', function () { expect(this.$('.vertical-item')).to.have.length(1) }) }) diff --git a/tests/integration/components/frost-list-expansion-test.js b/tests/integration/components/frost-list-expansion-test.js index 78ba56f..a7cc305 100644 --- a/tests/integration/components/frost-list-expansion-test.js +++ b/tests/integration/components/frost-list-expansion-test.js @@ -20,7 +20,7 @@ describe(test.label, function () { sandbox.restore() }) - it('renders with default class', function () { + it('should render with default class', function () { this.render(hbs` {{frost-list-expansion hook='myExpansion' @@ -32,7 +32,7 @@ describe(test.label, function () { expect(this.$('.frost-list-expansion')).to.be.length(1) }) - it('fires onCollapseAll closure action', function () { + it('should fire onCollapseAll closure action', function () { const collapseAllSpy = sandbox.spy() this.on('collapseAllAction', collapseAllSpy) @@ -50,7 +50,7 @@ describe(test.label, function () { expect(collapseAllSpy).have.callCount(1) }) - it('fires onExpandAll closure action', function () { + it('should fire onExpandAll closure action', function () { const expandAllSpy = sandbox.spy() this.on('expandAllAction', expandAllSpy) @@ -79,13 +79,13 @@ describe(test.label, function () { `) }) - it('sets -collapse-all hook correctly', function () { + it('should set -collapse-all hook correctly', function () { expect( $hook('myExpansion-collapse-all').text().trim() ).to.equal('Collapse all') }) - it('sets -expand-all hook correctly', function () { + it('should set -expand-all hook correctly', function () { expect( $hook('myExpansion-expand-all').text().trim() ).to.equal('Expand all') diff --git a/tests/integration/components/frost-list-item-content-test.js b/tests/integration/components/frost-list-item-content-test.js index a729a0e..6b232cd 100644 --- a/tests/integration/components/frost-list-item-content-test.js +++ b/tests/integration/components/frost-list-item-content-test.js @@ -52,23 +52,23 @@ describe(test.label, function () { unregisterMockComponent(this, 'mock-list-item-expansion') }) - it('sets "frost-list-item-content" class', function () { + it('should set "frost-list-item-content" class', function () { expect(this.$('.frost-list-item-content')).to.have.length(1) }) - it('creates one list item content', function () { + it('should create one list item content', function () { expect($hook('myListItemContent', {index: 0})).to.have.length(1) }) - it('concatenates the -item-container hook property', function () { + it('should concatenate the -item-container hook property', function () { expect($hook('myListItemContent-item-container', {index: 0})).to.have.length(1) }) - it('concatenates the -item hook property', function () { + it('should concatenate the -item hook property', function () { expect($hook('myListItemContent-item', {index: 0})).to.have.length(1) }) - it('concatenates the -expnansion hook property', function () { + it('should concatenate the -expnansion hook property', function () { expect($hook('myListItemContent-expansion', {index: 0})).to.have.length(1) }) }) diff --git a/tests/integration/components/frost-list-item-expansion-test.js b/tests/integration/components/frost-list-item-expansion-test.js index 283bcde..ab276f0 100644 --- a/tests/integration/components/frost-list-item-expansion-test.js +++ b/tests/integration/components/frost-list-item-expansion-test.js @@ -43,19 +43,19 @@ describe(test.label, function () { sandbox.restore() }) - it('renders with default class', function () { + it('should render with default class', function () { expect(this.$('.frost-list-item-expansion')).to.be.length(1) }) - it('adds correct class to frost-icon', function () { + it('should add correct class to frost-icon', function () { expect(this.$('.frost-list-item-expansion-icon')).to.be.length(1) }) - it('sets -icon hook correctly', function () { + it('should set -icon hook correctly', function () { expect($hook('myListItemExpansion-icon')).to.be.length(1) }) - it('sets the correct icon', function () { + it('should set the correct icon', function () { expect( $hook('myListItemExpansion-icon') ).to.have.class('frost-icon-frost-list-chevron-thin') @@ -66,11 +66,11 @@ describe(test.label, function () { $hook('myListItemExpansion').trigger('click') }) - it('fires onExpand closure action', function () { + it('should fire onExpand closure action', function () { expect(expandSpy).have.callCount(1) }) - it('passes the model', function () { + it('should pass the model', function () { expect(expandSpy.args[0][0].id).to.equal('400') }) }) diff --git a/tests/integration/components/frost-list-item-selection-test.js b/tests/integration/components/frost-list-item-selection-test.js index c24af32..cadf5a6 100644 --- a/tests/integration/components/frost-list-item-selection-test.js +++ b/tests/integration/components/frost-list-item-selection-test.js @@ -44,15 +44,15 @@ describe(test.label, function () { sandbox.restore() }) - it('renders with default class', function () { + it('should render with default class', function () { expect(this.$('.frost-list-item-selection')).to.be.length(1) }) - it('sets -checkbox hook correctly', function () { + it('should set -checkbox hook correctly', function () { expect($hook('myListItemSelection-checkbox')).to.be.length(1) }) - it('adds correct size to checkbox', function () { + it('should add correct size to checkbox', function () { expect($hook('myListItemSelection-checkbox')).to.have.class('medium') }) @@ -61,19 +61,19 @@ describe(test.label, function () { $hook('myListItemSelection').trigger('click') }) - it('fires onSelect closure action', function () { + it('should fire onSelect closure action', function () { expect(selectSpy).have.callCount(1) }) - it('passes the isRangeSelect property', function () { + it('should pass the isRangeSelect property', function () { expect(selectSpy.args[0][0]).to.have.property('isRangeSelect') }) - it('passes the isSpecificSelect property', function () { + it('should pass the isSpecificSelect property', function () { expect(selectSpy.args[0][0]).to.have.property('isSpecificSelect') }) - it('passes the model', function () { + it('should pass the model', function () { expect(selectSpy.args[0][0].item.id).to.equal('400') }) }) diff --git a/tests/integration/components/frost-list-item-test.js b/tests/integration/components/frost-list-item-test.js index 5d46841..ff2ac65 100644 --- a/tests/integration/components/frost-list-item-test.js +++ b/tests/integration/components/frost-list-item-test.js @@ -33,7 +33,7 @@ describe(test.label, function () { sandbox.restore() }) - it('renders with default class', function () { + it('should render with default class', function () { expect(this.$('.frost-list-item')).to.be.length(1) }) @@ -42,19 +42,19 @@ describe(test.label, function () { $hook('myListItem').trigger('click') }) - it('fires onSelect closure action', function () { + it('should fire onSelect closure action', function () { expect(selectSpy).have.callCount(1) }) - it('passes the isRangeSelect property', function () { + it('should pass the isRangeSelect property', function () { expect(selectSpy.args[0][0]).to.have.property('isRangeSelect') }) - it('passes the isSpecificSelect property', function () { + it('should pass the isSpecificSelect property', function () { expect(selectSpy.args[0][0]).to.have.property('isSpecificSelect') }) - it('passes the model', function () { + it('should pass the model', function () { expect(selectSpy.args[0][0].item.id).to.equal('400') }) }) diff --git a/tests/integration/components/frost-list-pagination-test.js b/tests/integration/components/frost-list-pagination-test.js index 57551d1..317f0d4 100644 --- a/tests/integration/components/frost-list-pagination-test.js +++ b/tests/integration/components/frost-list-pagination-test.js @@ -40,36 +40,36 @@ describe(test.label, function () { `) }) - it('sets frost-pagination class', function () { + it('should set frost-pagination class', function () { expect( this.$('.frost-list-pagination') ).to.have.length(1) }) - it('shows correct pagination text', function () { + it('should show correct pagination text', function () { expect( $hook('myHook-text').text().trim() ).to.eql('1 to 10 of 100') }) describe('hooks', function () { - it('sets "-first-page" hook', function () { + it('should set "-first-page" hook', function () { expect($hook('myHook-first-page')).to.have.length(1) }) - it('sets "-previous-page" hook', function () { + it('should set "-previous-page" hook', function () { expect($hook('myHook-previous-page')).to.have.length(1) }) - it('sets "-text" hook', function () { + it('should set "-text" hook', function () { expect($hook('myHook-text')).to.have.length(1) }) - it('sets "-next-page" hook', function () { + it('should set "-next-page" hook', function () { expect($hook('myHook-next-page')).to.have.length(1) }) - it('sets "-last-page" hook', function () { + it('should set "-last-page" hook', function () { expect($hook('myHook-last-page')).to.have.length(1) }) }) @@ -115,13 +115,13 @@ describe(test.label, function () { }) describe('disables buttons on the left', function () { - it('disables "first page" button', function () { + it('should disable "first page" button', function () { expect( $hook('myHook-first-page').prop('disabled') ).to.eql(true) }) - it('disables "previous page" button', function () { + it('should disable "previous page" button', function () { expect( $hook('myHook-previous-page').prop('disabled') ).to.eql(true) @@ -129,13 +129,13 @@ describe(test.label, function () { }) describe('enables buttons on the right', function () { - it('enables "last page" button', function () { + it('should enable "last page" button', function () { expect( $hook('myHook-last-page').prop('disabled') ).to.eql(false) }) - it('enables "next page" button', function () { + it('should enable "next page" button', function () { expect( $hook('myHook-next-page').prop('disabled') ).to.eql(false) @@ -160,32 +160,32 @@ describe(test.label, function () { `) }) - it('shows correct pagination text', function () { + it('should show correct pagination text', function () { expect( $hook('myHook-text').text().trim() ).to.eql('11 to 20 of 100') }) describe('enable all buttons', function () { - it('enables "first page" button', function () { + it('should enable "first page" button', function () { expect( $hook('myHook-first-page').prop('disabled') ).to.eql(false) }) - it('enables "previous page" button', function () { + it('should enable "previous page" button', function () { expect( $hook('myHook-previous-page').prop('disabled') ).to.eql(false) }) - it('enables "next page" button', function () { + it('should enable "next page" button', function () { expect( $hook('myHook-next-page').prop('disabled') ).to.eql(false) }) - it('enables "last page" button', function () { + it('should enable "last page" button', function () { expect( $hook('myHook-last-page').prop('disabled') ).to.eql(false) @@ -210,20 +210,20 @@ describe(test.label, function () { `) }) - it('shows correct pagination text', function () { + it('should show correct pagination text', function () { expect( $hook('myHook-text').text().trim() ).to.eql('91 to 100 of 100') }) describe('enables buttons on the left', function () { - it('enables "first page" button', function () { + it('should enable "first page" button', function () { expect( $hook('myHook-first-page').prop('disabled') ).to.eql(false) }) - it('enables "previous page" button', function () { + it('should enable "previous page" button', function () { expect( $hook('myHook-previous-page').prop('disabled') ).to.eql(false) @@ -231,13 +231,13 @@ describe(test.label, function () { }) describe('disables buttons on the right', function () { - it('disables "next page" button', function () { + it('should disable "next page" button', function () { expect( $hook('myHook-next-page').prop('disabled') ).to.eql(true) }) - it('disables "last page" button', function () { + it('should disable "last page" button', function () { expect( $hook('myHook-last-page').prop('disabled') ).to.eql(true) @@ -262,20 +262,20 @@ describe(test.label, function () { `) }) - it('shows correct pagination text', function () { + it('should show correct pagination text', function () { expect( $hook('myHook-text').text().trim() ).to.eql('0 results found') }) describe('disables buttons on the right', function () { - it('disables "next page" button', function () { + it('should disable "next page" button', function () { expect( $hook('myHook-next-page').prop('disabled') ).to.eql(true) }) - it('disables "last page" button', function () { + it('should disable "last page" button', function () { expect( $hook('myHook-last-page').prop('disabled') ).to.eql(true) @@ -308,7 +308,7 @@ describe(test.label, function () { return wait() }) - it('fires onChange closure action', function () { + it('should fire onChange closure action', function () { this.$('.frost-button').trigger('click') return wait().then(() => { diff --git a/tests/integration/components/frost-list-test.js b/tests/integration/components/frost-list-test.js index 02679b6..c245777 100644 --- a/tests/integration/components/frost-list-test.js +++ b/tests/integration/components/frost-list-test.js @@ -23,7 +23,7 @@ describe(test.label, function () { sandbox.restore() }) - it('unregisters event handler with same handler used with on', function () { + it('should unregister event handler with same handler used with on', function () { sandbox.spy($.fn, 'on') sandbox.spy($.fn, 'off') @@ -70,11 +70,11 @@ describe(test.label, function () { return wait() }) - it('sets "frost-list" class', function () { + it('should set "frost-list" class', function () { expect(this.$('.frost-list')).to.have.length(1) }) - it('creates one list item', function () { + it('should create one list item', function () { expect($hook('myList-itemContent-item')).to.have.length(1) }) }) @@ -98,7 +98,7 @@ describe(test.label, function () { return wait() }) - it('sets "frost-list-item" row height to 50px', function () { + it('should set "frost-list-item" row height to 50px', function () { expect($hook('myList-itemContent-item-container').height()).to.equal(50) }) }) @@ -130,7 +130,7 @@ describe(test.label, function () { return wait() }) - it('sets "frost-list-item" row height to 30px', function () { + it('should set "frost-list-item" row height to 30px', function () { expect($hook('myList-itemContent-item-container').height()).to.equal(30) }) @@ -138,7 +138,7 @@ describe(test.label, function () { expect($hook('myList-itemContent-selection-checkbox').hasClass('small')).to.eql(true) }) - it('after click, should display small checkbox', function () { + it('should after click, display small checkbox', function () { const $el = $hook('myList-itemContent-selection-checkbox') $el.click() expect($el.hasClass('small')).to.eql(true) @@ -164,7 +164,7 @@ describe(test.label, function () { return wait() }) - it('sets "frost-list-item" row height to default 50px', function () { + it('should set "frost-list-item" row height to default 50px', function () { expect($hook('myList-itemContent-item-container').height()).to.equal(50) }) }) @@ -188,7 +188,7 @@ describe(test.label, function () { return wait() }) - it('sets "frost-list-item" row height to 60px.', function () { + it('should set "frost-list-item" row height to 60px.', function () { expect($hook('myList-itemContent-item-container').height()).to.equal(60) }) }) @@ -213,7 +213,7 @@ describe(test.label, function () { return wait() }) - it('size attribute gets ignored.', function () { + it('should have size attribute get ignored.', function () { expect($hook('myList-itemContent-item-container').height()).to.equal(60) }) }) @@ -344,7 +344,7 @@ describe(test.label, function () { unregisterMockComponent(this, 'mock-item-expansion') }) - it('did not render the itemExpansion component when "model.isExpanded" is "false"', function () { + it('should not render the itemExpansion component when "model.isExpanded" is "false"', function () { expect(this.$('.mock-item-expansion')).to.have.length(0) }) @@ -425,15 +425,15 @@ describe(test.label, function () { return wait() }) - it('item 0 is selected', function () { + it('should have item 0 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 0}).hasClass('is-selected')).to.eql(true) }) - it('item 1 is not selected', function () { + it('should have item 1 is not selected', function () { expect($hook('myList-itemContent-item-container', {index: 1}).hasClass('is-selected')).to.eql(false) }) - it('selectedItems length to be 1', function () { + it('should have selectedItems length to be 1', function () { expect(this.get('selectedItems').length).to.eql(1) }) }) @@ -465,14 +465,14 @@ describe(test.label, function () { return wait() }) - it('item 0 is selected', function () { + it('should have item 0 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 0}).hasClass('is-selected')).to.eql(true) }) - it('item 1 is not selected', function () { + it('should have item 1 is not selected', function () { expect($hook('myList-itemContent-container', {index: 1}).hasClass('is-selected')).to.eql(false) }) - it('selectedItems length to be 1', function () { + it('should have selectedItems length to be 1', function () { expect(this.get('selectedItems').length).to.eql(1) }) }) @@ -513,19 +513,19 @@ describe(test.label, function () { return wait() }) - it('item 0 is selected', function () { + it('should have item 0 is selected', function () { return wait().then(() => { expect($hook('myList-itemContent-item-container', {index: 0}).hasClass('is-selected')).to.eql(true) }) }) - it('item 1 is not selected', function () { + it('should have item 1 is not selected', function () { return wait().then(() => { expect($hook('myList-itemContent-item-container', {index: 1}).hasClass('is-selected')).to.eql(false) }) }) - it('selectedItems length to be 1', function () { + it('should have selectedItems length to be 1', function () { return wait().then(() => { expect(this.get('selectedItems').length).to.eql(1) }) @@ -537,15 +537,15 @@ describe(test.label, function () { return wait() }) - it('item 0 is not selected', function () { + it('should have item 0 is not selected', function () { expect($hook('myList-itemContent-item-container', {index: 0}).hasClass('is-selected')).to.eql(false) }) - it('item 1 is not selected', function () { + it('should have item 1 is not selected', function () { expect($hook('myList-itemContent-item-container', {index: 1}).hasClass('is-selected')).to.eql(false) }) - it('selectedItems length to be 0', function () { + it('should have selectedItems length to be 0', function () { expect(this.get('selectedItems').length).to.eql(0) }) }) @@ -559,15 +559,15 @@ describe(test.label, function () { return wait() }) - it('item 0 is selected', function () { + it('should have item 0 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 0}).hasClass('is-selected')).to.eql(true) }) - it('item 1 is not selected', function () { + it('should have item 1 is not selected', function () { expect($hook('myList-itemContent-item-container', {index: 1}).hasClass('is-selected')).to.eql(false) }) - it('selectedItems length to be 1', function () { + it('should have selectedItems length to be 1', function () { expect(this.get('selectedItems').length).to.eql(1) }) }) @@ -580,14 +580,14 @@ describe(test.label, function () { return wait() }) - it('item 0 is selected', function () { + it('should have item 0 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 0}).hasClass('is-selected')).to.eql(true) }) - it('item 1 is not selected', function () { + it('should have item 1 is not selected', function () { expect($hook('myList-itemContent-item-container', {index: 1}).hasClass('is-selected')).to.eql(false) }) - it('selectedItems length to be 1', function () { + it('should have selectedItems length to be 1', function () { expect(this.get('selectedItems').length).to.eql(1) }) @@ -597,15 +597,15 @@ describe(test.label, function () { return wait() }) - it('item 0 is not selected', function () { + it('should have item 0 is not selected', function () { expect($($hook('myList-itemContent-item-container', {index: 0})).hasClass('is-selected')).to.eql(false) }) - it('item 1 is not selected', function () { + it('should have item 1 is not selected', function () { expect($($hook('myList-itemContent-item-container', {index: 1})).hasClass('is-selected')).to.eql(false) }) - it('selectedItems length to be 0', function () { + it('should have selectedItems length to be 0', function () { expect(this.get('selectedItems').length).to.eql(0) }) }) @@ -618,15 +618,15 @@ describe(test.label, function () { return wait() }) - it('item 0 is selected', function () { + it('should have item 0 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 0}).hasClass('is-selected')).to.eql(true) }) - it('item 1 is selected', function () { + it('should have item 1 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 1}).hasClass('is-selected')).to.eql(true) }) - it('selectedItems length to be 2', function () { + it('should have selectedItems length to be 2', function () { expect(this.get('selectedItems').length).to.eql(2) }) @@ -637,15 +637,15 @@ describe(test.label, function () { return wait() }) - it('item 0 is not selected', function () { + it('should have item 0 is not selected', function () { expect($hook('myList-itemContent-item-container', {index: 0}).hasClass('is-selected')).to.eql(false) }) - it('item 1 is not selected', function () { + it('should have item 1 is not selected', function () { expect($hook('myList-itemContent-item-container', {index: 1}).hasClass('is-selected')).to.eql(false) }) - it('selectedItems length to be 0', function () { + it('should have selectedItems length to be 0', function () { expect(this.get('selectedItems').length).to.eql(0) }) }) @@ -678,35 +678,35 @@ describe(test.label, function () { return wait() }) - it('item 0 is not selected', function () { + it('should have item 0 is not selected', function () { expect($hook('myList-itemContent-item-container', {index: 0}).hasClass('is-selected')).to.eql(false) }) - it('item 1 is selected', function () { + it('should have item 1 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 1}).hasClass('is-selected')).to.eql(true) }) - it('item 2 is selected', function () { + it('should have item 2 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 2}).hasClass('is-selected')).to.eql(true) }) - it('item 3 is selected', function () { + it('should have item 3 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 3}).hasClass('is-selected')).to.eql(true) }) - it('item 4 is selected', function () { + it('should have item 4 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 4}).hasClass('is-selected')).to.eql(true) }) - it('item 5 is selected', function () { + it('should have item 5 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 5}).hasClass('is-selected')).to.eql(true) }) - it('item 6 is not selected', function () { + it('should have item 6 is not selected', function () { expect($hook('myList-itemContent-item-container', {index: 6}).hasClass('is-selected')).to.eql(false) }) - it('selectedItems length to be 5', function () { + it('should have selectedItems length to be 5', function () { expect(this.get('selectedItems').length).to.eql(5) }) }) @@ -719,35 +719,35 @@ describe(test.label, function () { return wait() }) - it('item 0 is not selected', function () { + it('should have item 0 is not selected', function () { expect($hook('myList-itemContent-item-container', {index: 0}).hasClass('is-selected')).to.eql(false) }) - it('item 1 is selected', function () { + it('should have item 1 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 1}).hasClass('is-selected')).to.eql(true) }) - it('item 2 is not selected', function () { + it('should have item 2 is not selected', function () { expect($hook('myList-itemContent-item-container', {index: 2}).hasClass('is-selected')).to.eql(false) }) - it('item 3 is not selected', function () { + it('should have item 3 is not selected', function () { expect($hook('myList-itemContent-item-container', {index: 3}).hasClass('is-selected')).to.eql(false) }) - it('item 4 is not selected', function () { + it('should have item 4 is not selected', function () { expect($hook('myList-itemContent-item-container', {index: 4}).hasClass('is-selected')).to.eql(false) }) - it('item 5 is not selected', function () { + it('should have item 5 is not selected', function () { expect($hook('myList-itemContent-item-container', {index: 5}).hasClass('is-selected')).to.eql(false) }) - it('item 6 is not selected', function () { + it('should have item 6 is not selected', function () { expect($hook('myList-itemContent-item-container', {index: 6}).hasClass('is-selected')).to.eql(false) }) - it('selectedItems length to be 1', function () { + it('should have selectedItems length to be 1', function () { expect(this.get('selectedItems').length).to.eql(1) }) @@ -759,35 +759,35 @@ describe(test.label, function () { return wait() }) - it('item 0 is not selected', function () { + it('should have item 0 is not selected', function () { expect($hook('myList-itemContent-item-container', {index: 0}).hasClass('is-selected')).to.eql(false) }) - it('item 1 is selected', function () { + it('should have item 1 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 1}).hasClass('is-selected')).to.eql(true) }) - it('item 2 is selected', function () { + it('should have item 2 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 2}).hasClass('is-selected')).to.eql(true) }) - it('item 3 is selected', function () { + it('should have item 3 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 3}).hasClass('is-selected')).to.eql(true) }) - it('item 4 is not selected', function () { + it('should have item 4 is not selected', function () { expect($hook('myList-itemContent-item-container', {index: 4}).hasClass('is-selected')).to.eql(false) }) - it('item 5 is not selected', function () { + it('should have item 5 is not selected', function () { expect($hook('myList-itemContent-item-container', {index: 5}).hasClass('is-selected')).to.eql(false) }) - it('item 6 is not selected', function () { + it('should have item 6 is not selected', function () { expect($hook('myList-itemContent-item-container', {index: 6}).hasClass('is-selected')).to.eql(false) }) - it('selectedItems length to be 3', function () { + it('should have selectedItems length to be 3', function () { expect(this.get('selectedItems').length).to.eql(3) }) @@ -799,35 +799,35 @@ describe(test.label, function () { return wait() }) - it('item 0 is not selected', function () { + it('should have item 0 is not selected', function () { expect($hook('myList-itemContent-item-container', {index: 0}).hasClass('is-selected')).to.eql(false) }) - it('item 1 is selected', function () { + it('should have item 1 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 1}).hasClass('is-selected')).to.eql(true) }) - it('item 2 is selected', function () { + it('should have item 2 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 2}).hasClass('is-selected')).to.eql(true) }) - it('item 3 is selected', function () { + it('should have item 3 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 3}).hasClass('is-selected')).to.eql(true) }) - it('item 4 is selected', function () { + it('should have item 4 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 4}).hasClass('is-selected')).to.eql(true) }) - it('item 5 is selected', function () { + it('should have item 5 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 5}).hasClass('is-selected')).to.eql(true) }) - it('item 6 is not selected', function () { + it('should have item 6 is not selected', function () { expect($hook('myList-itemContent-item-container', {index: 6}).hasClass('is-selected')).to.eql(false) }) - it('selectedItems length to be 5', function () { + it('should have selectedItems length to be 5', function () { expect(this.get('selectedItems').length).to.eql(5) }) @@ -839,35 +839,35 @@ describe(test.label, function () { return wait() }) - it('item 0 is not selected', function () { + it('should have item 0 is not selected', function () { expect($hook('myList-itemContent-item-container', {index: 0}).hasClass('is-selected')).to.eql(false) }) - it('item 1 is selected', function () { + it('should have item 1 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 1}).hasClass('is-selected')).to.eql(true) }) - it('item 2 is not selected', function () { + it('should have item 2 is not selected', function () { expect($hook('myList-itemContent-item-container', {index: 2}).hasClass('is-selected')).to.eql(false) }) - it('item 3 is not selected', function () { + it('should have item 3 is not selected', function () { expect($hook('myList-itemContent-item-container', {index: 3}).hasClass('is-selected')).to.eql(false) }) - it('item 4 is not selected', function () { + it('should have item 4 is not selected', function () { expect($hook('myList-itemContent-item-container', {index: 4}).hasClass('is-selected')).to.eql(false) }) - it('item 5 is not selected', function () { + it('should have item 5 is not selected', function () { expect($hook('myList-itemContent-item-container', {index: 5}).hasClass('is-selected')).to.eql(false) }) - it('item 6 is not selected', function () { + it('should have item 6 is not selected', function () { expect($hook('myList-itemContent-item-container', {index: 6}).hasClass('is-selected')).to.eql(false) }) - it('selectedItems length to be 1', function () { + it('should have selectedItems length to be 1', function () { expect(this.get('selectedItems').length).to.eql(1) }) }) @@ -880,35 +880,35 @@ describe(test.label, function () { return wait() }) - it('item 0 is selected', function () { + it('should have item 0 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 0}).hasClass('is-selected')).to.eql(true) }) - it('item 1 is selected', function () { + it('should have item 1 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 1}).hasClass('is-selected')).to.eql(true) }) - it('item 2 is not selected', function () { + it('should have item 2 is not selected', function () { expect($hook('myList-itemContent-item-container', {index: 2}).hasClass('is-selected')).to.eql(false) }) - it('item 3 is not selected', function () { + it('should have item 3 is not selected', function () { expect($hook('myList-itemContent-item-container', {index: 3}).hasClass('is-selected')).to.eql(false) }) - it('item 4 is not selected', function () { + it('should have item 4 is not selected', function () { expect($hook('myList-itemContent-item-container', {index: 4}).hasClass('is-selected')).to.eql(false) }) - it('item 5 is not selected', function () { + it('should have item 5 is not selected', function () { expect($hook('myList-itemContent-item-container', {index: 5}).hasClass('is-selected')).to.eql(false) }) - it('item 6 is not selected', function () { + it('should have item 6 is not selected', function () { expect($hook('myList-itemContent-item-container', {index: 6}).hasClass('is-selected')).to.eql(false) }) - it('selectedItems length to be 2', function () { + it('should have selectedItems length to be 2', function () { expect(this.get('selectedItems').length).to.eql(2) }) }) @@ -976,7 +976,7 @@ describe(test.label, function () { return wait() }) - it('display proper pagination 1 to 3 of 6', function () { + it('should display proper pagination 1 to 3 of 6', function () { expect($('.frost-list-pagination-text').text().trim()).to.eql('1 to 3 of 6') }) @@ -991,19 +991,19 @@ describe(test.label, function () { return wait() }) - it('item 0 is selected', function () { + it('should have item 0 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 0}).hasClass('is-selected')).to.eql(true) }) - it('item 1 is selected', function () { + it('should have item 1 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 1}).hasClass('is-selected')).to.eql(true) }) - it('item 2 is selected', function () { + it('should have item 2 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 2}).hasClass('is-selected')).to.eql(true) }) - it('selectedItems length to be 3', function () { + it('should have selectedItems length to be 3', function () { expect(this.get('selectedItems').length).to.eql(3) }) @@ -1013,23 +1013,23 @@ describe(test.label, function () { return wait() }) - it('item 0 is not selected', function () { + it('should have item 0 is not selected', function () { expect($hook('myList-itemContent-item-container', {index: 0}).hasClass('is-selected')).to.eql(false) }) - it('item 1 is not selected', function () { + it('should have item 1 is not selected', function () { expect($hook('myList-itemContent-item-container', {index: 1}).hasClass('is-selected')).to.eql(false) }) - it('item 2 is not selected', function () { + it('should have item 2 is not selected', function () { expect($hook('myList-itemContent-item-container', {index: 2}).hasClass('is-selected')).to.eql(false) }) - it('selectedItems length to be 3', function () { + it('should have selectedItems length to be 3', function () { expect(this.get('selectedItems').length).to.eql(3) }) - it('display proper pagination 4 to 6 of 6', function () { + it('should display proper pagination 4 to 6 of 6', function () { expect($('.frost-list-pagination-text').text().trim()).to.eql('4 to 6 of 6') }) @@ -1043,19 +1043,19 @@ describe(test.label, function () { $hook('myList-itemContent-item', {index: 2}).trigger(clickEvent2) return wait() }) - it('item 0 is selected', function () { + it('should have item 0 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 0}).hasClass('is-selected')).to.eql(true) }) - it('item 1 is selected', function () { + it('should have item 1 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 1}).hasClass('is-selected')).to.eql(true) }) - it('item 2 is selected', function () { + it('should have item 2 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 2}).hasClass('is-selected')).to.eql(true) }) - it('selectedItems length to be 6', function () { + it('should have selectedItems length to be 6', function () { expect(this.get('selectedItems').length).to.eql(6) }) }) @@ -1068,19 +1068,19 @@ describe(test.label, function () { return wait() }) - it('item 0 is not selected', function () { + it('should have item 0 is not selected', function () { expect($hook('myList-itemContent-item-container', {index: 0}).hasClass('is-selected')).to.eql(false) }) - it('item 1 is selected', function () { + it('should have item 1 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 1}).hasClass('is-selected')).to.eql(true) }) - it('item 2 is not selected', function () { + it('should have item 2 is not selected', function () { expect($hook('myList-itemContent-item-container', {index: 2}).hasClass('is-selected')).to.eql(false) }) - it('selectedItems length to be 1', function () { + it('should have selectedItems length to be 1', function () { expect(this.get('selectedItems').length).to.eql(1) }) @@ -1098,19 +1098,19 @@ describe(test.label, function () { }) }) - it('item 0 is selected', function () { + it('should have item 0 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 0}).hasClass('is-selected')).to.eql(true) }) - it('item 1 is selected', function () { + it('should have item 1 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 1}).hasClass('is-selected')).to.eql(true) }) - it('item 2 is selected', function () { + it('should have item 2 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 2}).hasClass('is-selected')).to.eql(true) }) - it('selectedItems length to be 4', function () { + it('should have selectedItems length to be 4', function () { expect(this.get('selectedItems').length).to.eql(4) }) @@ -1128,19 +1128,19 @@ describe(test.label, function () { }) }) - it('item 0 is selected', function () { + it('should have item 0 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 0}).hasClass('is-selected')).to.eql(true) }) - it('item 1 is selected', function () { + it('should have item 1 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 1}).hasClass('is-selected')).to.eql(true) }) - it('item 2 is selected', function () { + it('should have item 2 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 2}).hasClass('is-selected')).to.eql(true) }) - it('selectedItems length to be 6', function () { + it('should have selectedItems length to be 6', function () { expect(this.get('selectedItems').length).to.eql(6) }) }) @@ -1193,35 +1193,35 @@ describe(test.label, function () { return wait() }) - it('item 0 is not selected', function () { + it('should have item 0 is not selected', function () { expect($hook('myList-itemContent-item-container', {index: 0}).hasClass('is-selected')).to.eql(false) }) - it('item 1 is selected', function () { + it('should have item 1 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 1}).hasClass('is-selected')).to.eql(true) }) - it('item 2 is selected', function () { + it('should have item 2 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 2}).hasClass('is-selected')).to.eql(true) }) - it('item 3 is selected', function () { + it('should have item 3 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 3}).hasClass('is-selected')).to.eql(true) }) - it('item 4 is selected', function () { + it('should have item 4 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 4}).hasClass('is-selected')).to.eql(true) }) - it('item 5 is selected', function () { + it('should have item 5 is selected', function () { expect($hook('myList-itemContent-item-container', {index: 5}).hasClass('is-selected')).to.eql(true) }) - it('item 6 is not selected', function () { + it('should have item 6 is not selected', function () { expect($hook('myList-itemContent-item-container', {index: 6}).hasClass('is-selected')).to.eql(false) }) - it('selectedItems length to be 5', function () { + it('should have selectedItems length to be 5', function () { expect(this.get('selectedItems').length).to.eql(5) }) }) @@ -1268,7 +1268,7 @@ describe(test.label, function () { return wait() }) - it('item 0 is expanded', function () { + it('should have item 0 is expanded', function () { expect($hook('myList-itemContent-itemExpansion', {index: 0})).to.have.length(1) }) @@ -1277,7 +1277,7 @@ describe(test.label, function () { $hook('myList-itemContent-expansion', {index: 0}).click() return wait() }) - it('item 0 is not expanded', function () { + it('should have item 0 is not expanded', function () { expect($hook('myList-itemContent-itemExpansion', {index: 0})).to.have.length(0) }) }) @@ -1289,11 +1289,11 @@ describe(test.label, function () { return wait() }) - it('item 0 is expanded', function () { + it('should have item 0 is expanded', function () { expect($hook('myList-itemContent-itemExpansion', {index: 0})).to.have.length(1) }) - it('item 1 is expanded', function () { + it('should have item 1 is expanded', function () { expect($hook('myList-itemContent-itemExpansion', {index: 1})).to.have.length(1) }) }) diff --git a/tests/unit/helpers/floor-test.js b/tests/unit/helpers/floor-test.js index 236307d..bb22ff6 100644 --- a/tests/unit/helpers/floor-test.js +++ b/tests/unit/helpers/floor-test.js @@ -3,12 +3,12 @@ import {floor} from 'ember-frost-list/helpers/floor' import {describe, it} from 'mocha' describe('Unit / Helper / floor', function () { - it('works for positive numbers', function () { + it('should work for positive numbers', function () { let result = floor([42.8]) expect(result).to.equal(42) }) - it('works for negative numbers', function () { + it('should work for negative numbers', function () { let result = floor([-42.8]) expect(result).to.equal(-43) }) diff --git a/tests/unit/helpers/is-lead-selection.js b/tests/unit/helpers/is-lead-selection.js index 45741d4..043bef9 100644 --- a/tests/unit/helpers/is-lead-selection.js +++ b/tests/unit/helpers/is-lead-selection.js @@ -6,7 +6,7 @@ import {describe, it} from 'mocha' describe.skip('Unit / Helper / is-lead-selection', function () { // Replace this with your real tests. - it('works', function () { + it('should work', function () { let result = floor([42.8]) expect(result).to.equal(42) }) diff --git a/tests/unit/utils/selection-test.js b/tests/unit/utils/selection-test.js index 805c0e7..3f04455 100644 --- a/tests/unit/utils/selection-test.js +++ b/tests/unit/utils/selection-test.js @@ -230,21 +230,21 @@ describe('Unit / Utility / selection', function () { describe('isSupportedInEnvironment()', function () { describe('when objectName is not an object', function () { - it('returns false', function () { + it('should return false', function () { expect(selection.isSupportedInEnvironment('testObject', 'testMethod')).to.be.equal(false) }) }) describe('when methodName is not an string', function () { let testObject = {testMethod: function () {}} - it('returns false', function () { + it('should return false', function () { expect(selection.isSupportedInEnvironment(testObject, 1)).to.be.equal(false) }) }) describe('when objectName is an "Object" and methodName is a "String"', function () { let testObject = {testMethod: function () {}} - it('returns true', function () { + it('should return true', function () { expect(selection.isSupportedInEnvironment(testObject, 'testMethod')).to.be.equal(true) }) }) From a9cdf1aa653d83e1a82ebde9d0628c9ee29be1ea Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Wed, 24 Jan 2018 12:17:09 -0600 Subject: [PATCH 05/25] remove useLintTree ember-cli-mocha configuration from ember-cli-build.js --- ember-cli-build.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/ember-cli-build.js b/ember-cli-build.js index 98a63fa..1211886 100644 --- a/ember-cli-build.js +++ b/ember-cli-build.js @@ -3,9 +3,6 @@ const EmberAddon = require('ember-cli/lib/broccoli/ember-addon') module.exports = function (defaults) { let app = new EmberAddon(defaults, { - 'ember-cli-mocha': { - useLintTree: false - }, sassOptions: { includePaths: [ ] From 3924e82e6b78342c70f3b8c8dadf1a9c20f86ea2 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Wed, 24 Jan 2018 12:18:29 -0600 Subject: [PATCH 06/25] move code coverage config file to correct directory --- {config => tests/dummy/config}/coverage.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {config => tests/dummy/config}/coverage.js (100%) diff --git a/config/coverage.js b/tests/dummy/config/coverage.js similarity index 100% rename from config/coverage.js rename to tests/dummy/config/coverage.js From 1efca2b23be1db471498f50cc4e6886ffa643b60 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Wed, 24 Jan 2018 12:20:36 -0600 Subject: [PATCH 07/25] move Faker and jquery-mockjax bower packages to devDependencies --- bower.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bower.json b/bower.json index 22baa40..7616fc9 100644 --- a/bower.json +++ b/bower.json @@ -1,8 +1,10 @@ { "name": "ember-frost-list", "dependencies": { + "animation-frame": "~0.2.4" + }, + "devDependencies": { "Faker": "^3.1.0", - "animation-frame": "~0.2.4", "jquery-mockjax": "2.2.1" } } From 2c725c517a41a5247fe6c3f1afed5e193b51691d Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Wed, 24 Jan 2018 13:38:49 -0600 Subject: [PATCH 08/25] update ember-cli-code-coverage to 0.3.12 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a881ee4..65e6bab 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "ember-async-image": "0.1.1", "ember-cli": "2.12.3", "ember-cli-chai": "0.4.3", - "ember-cli-code-coverage": "0.3.5", + "ember-cli-code-coverage": "0.3.12", "ember-cli-dependency-checker": "^1.3.0", "ember-cli-htmlbars-inline-precompile": "0.3.12", "ember-cli-inject-live-reload": "^1.4.1", From 3559155fe2e06253bba77eee548ff4c53abc3be5 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Wed, 24 Jan 2018 13:39:30 -0600 Subject: [PATCH 09/25] update ember-code-snippet to 1.7.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 65e6bab..a0dd403 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "ember-cli-notifications": "^4.0.1", "ember-cli-shims": "^1.0.2", "ember-cli-uglify": "^1.2.0", - "ember-code-snippet": "1.8.0", + "ember-code-snippet": "1.7.0", "ember-data": "~2.12.0", "ember-data-factory-guy": "2.8.2", "ember-disable-prototype-extensions": "^1.1.0", From b06db423989f82cc54408ef01e3666d1e1299f75 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Wed, 24 Jan 2018 14:20:52 -0600 Subject: [PATCH 10/25] removed unused ember-async-image package --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index a0dd403..ff2af5f 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,6 @@ "bower": "^1.8.2", "broccoli-asset-rev": "^2.4.5", "chai-jquery": "^2.0.0", - "ember-async-image": "0.1.1", "ember-cli": "2.12.3", "ember-cli-chai": "0.4.3", "ember-cli-code-coverage": "0.3.12", From 372eedbefbe65072b3af845bb3bbc61dcb73e695 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Wed, 24 Jan 2018 14:24:19 -0600 Subject: [PATCH 11/25] remove unused pull-report package --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index ff2af5f..31fa0b1 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,6 @@ "ember-test-utils": "^8.1.0", "loader.js": "^4.2.3", "pr-bumper": "^1.11.0", - "pull-report": "^0.3.1", "sinon-chai": "^2.14.0" }, "keywords": [ From 7348f42c3013453fbcb52e18541283cf06a4122a Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Wed, 24 Jan 2018 14:34:45 -0600 Subject: [PATCH 12/25] update ua-parser-js to ^0.7.17 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 31fa0b1..359ae63 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "ember-prop-types": "^5.0.2", "ember-truth-helpers": "1.3.0", "smoke-and-mirrors": "github:ciena-frost/smoke-and-mirrors", - "ua-parser-js": "^0.7.12" + "ua-parser-js": "^0.7.17" }, "ember-addon": { "configPath": "tests/dummy/config" From fbde3c2d3ecfdd401419507ae8da1e69f96a3661 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Wed, 24 Jan 2018 16:23:10 -0600 Subject: [PATCH 13/25] remove ua-parser-js file in vendor and create vendor shim and imports to comsume npm package --- .DS_Store | Bin 0 -> 6148 bytes addon/components/frost-list-item-selection.js | 3 ++- addon/components/frost-list-item.js | 3 ++- index.js | 15 +++++++++++++-- package.json | 2 ++ vendor/shims/ua-parser-js.js | 15 +++++++++++++++ vendor/ua-parser.min.js | 8 -------- 7 files changed, 34 insertions(+), 12 deletions(-) create mode 100644 .DS_Store create mode 100644 vendor/shims/ua-parser-js.js delete mode 100644 vendor/ua-parser.min.js diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..3e391de0f729d619dabea1aac629bcd83153700f GIT binary patch literal 6148 zcmeHKyG{c^3>-s>NTf(fxxc_4tfKG*`G8O)q6rrX6zZ$^EAYi)7o2gx1*ci{^@MX*7=m@2@Q-+V z-@Oi}^YEPaU%x5vab1>=e=-D3_9~cC+cUwb&*MdzgFN2OO6(D literal 0 HcmV?d00001 diff --git a/addon/components/frost-list-item-selection.js b/addon/components/frost-list-item-selection.js index 193887c..445ba4c 100644 --- a/addon/components/frost-list-item-selection.js +++ b/addon/components/frost-list-item-selection.js @@ -7,6 +7,7 @@ const {ViewUtils} = Ember const {isSimpleClick} = ViewUtils import {Component} from 'ember-frost-core' import {PropTypes} from 'ember-prop-types' +import UAParser from 'ua-parser-js' import layout from '../templates/components/frost-list-item-selection' @@ -47,7 +48,7 @@ export default Component.extend({ // Acceptable event modifiers // When the checkbox is the target a simple click is equivalent to a specific select const isSpecificSelect = isSimpleClick(event) || - ((new window.UAParser()).getOS() === 'Mac OS' ? event.ctrlKey : event.metaKey) // TODO Move instance to a service + ((new UAParser()).getOS() === 'Mac OS' ? event.ctrlKey : event.metaKey) // TODO Move instance to a service const isRangeSelect = event.shiftKey // Only process simple clicks or clicks with the acceptable modifiers diff --git a/addon/components/frost-list-item.js b/addon/components/frost-list-item.js index c0b4053..8b07663 100644 --- a/addon/components/frost-list-item.js +++ b/addon/components/frost-list-item.js @@ -7,6 +7,7 @@ const {ViewUtils} = Ember const {isSimpleClick} = ViewUtils import {Component} from 'ember-frost-core' import {PropTypes} from 'ember-prop-types' +import UAParser from 'ua-parser-js' export default Component.extend({ @@ -44,7 +45,7 @@ export default Component.extend({ click (event) { // Acceptable event modifiers // TODO Move instance to a service - const isSpecificSelect = (new window.UAParser()).getOS().name === 'Mac OS' ? event.metaKey : event.ctrlKey + const isSpecificSelect = (new UAParser()).getOS().name === 'Mac OS' ? event.metaKey : event.ctrlKey const isRangeSelect = event.shiftKey // Only process simple clicks or clicks with the acceptable modifiers diff --git a/index.js b/index.js index 53bc095..05ca225 100644 --- a/index.js +++ b/index.js @@ -3,6 +3,8 @@ 'use strict' const path = require('path') +const MergeTrees = require('broccoli-merge-trees') +const Funnel = require('broccoli-funnel') module.exports = { name: 'ember-frost-list', @@ -13,10 +15,11 @@ module.exports = { this.app = app = app.app } - this._super.included.apply(this, app) + this._super.included.apply(this, arguments) if (app) { app.import(path.join('vendor', 'ua-parser.min.js')) + app.import(path.join('vendor', 'shims', 'ua-parser-js.js')) } }, @@ -33,6 +36,14 @@ module.exports = { /* eslint-disable no-unused-expressions */ this._super.init && this._super.init.apply(this, arguments) /* eslint-enable no-unused-expressions */ - } + }, /* eslint-enable complexity */ + + treeForVendor: function (vendorTree) { + const packageTree = new Funnel(path.join(this.project.root, 'node_modules', 'ua-parser-js', 'dist'), { + files: ['ua-parser.min.js'] + }) + + return new MergeTrees([vendorTree, packageTree]) + } } diff --git a/package.json b/package.json index 359ae63..0c39293 100644 --- a/package.json +++ b/package.json @@ -63,6 +63,8 @@ "frost" ], "dependencies": { + "broccoli-funnel": "^2.0.1", + "broccoli-merge-trees": "^2.0.0", "ember-cli-babel": "^5.1.7", "ember-cli-htmlbars": "^1.1.1", "ember-cli-sass": "5.6.0", diff --git a/vendor/shims/ua-parser-js.js b/vendor/shims/ua-parser-js.js new file mode 100644 index 0000000..890f959 --- /dev/null +++ b/vendor/shims/ua-parser-js.js @@ -0,0 +1,15 @@ +/* eslint-env node:true */ +/* globals define, self */ + +(function() { + function vendorModule() { + 'use strict'; + + return { + 'default': self['UAParser'], + __esModule: true, + }; + } + + define('ua-parser-js', [], vendorModule); +})(); \ No newline at end of file diff --git a/vendor/ua-parser.min.js b/vendor/ua-parser.min.js deleted file mode 100644 index a8b39a1..0000000 --- a/vendor/ua-parser.min.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * UAParser.js v0.7.12 - * Lightweight JavaScript-based User-Agent string parser - * https://github.com/faisalman/ua-parser-js - * - * Copyright © 2012-2016 Faisal Salman - * Dual licensed under GPLv2 & MIT - */(function(e,t){"use strict";var n="0.7.12",r="",i="?",s="function",o="undefined",u="object",a="string",f="major",l="model",c="name",h="type",p="vendor",d="version",v="architecture",m="console",g="mobile",y="tablet",b="smarttv",w="wearable",E="embedded",S={extend:function(e,t){var n={};for(var r in e)t[r]&&t[r].length%2===0?n[r]=t[r].concat(e[r]):n[r]=e[r];return n},has:function(e,t){return typeof e=="string"?t.toLowerCase().indexOf(e.toLowerCase())!==-1:!1},lowerize:function(e){return e.toLowerCase()},major:function(e){return typeof e===a?e.replace(/[^\d\.]/g,"").split(".")[0]:t},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},x={rgx:function(){var e,n=0,r,i,a,f,l,c,h=arguments;while(n0?f.length==2?typeof f[1]==s?e[f[0]]=f[1].call(this,c):e[f[0]]=f[1]:f.length==3?typeof f[1]===s&&(!f[1].exec||!f[1].test)?e[f[0]]=c?f[1].call(this,c,f[2]):t:e[f[0]]=c?c.replace(f[1],f[2]):t:f.length==4&&(e[f[0]]=c?f[3].call(this,c.replace(f[1],f[2])):t):e[f]=c?c:t}n+=2}return e},str:function(e,n){for(var r in n)if(typeof n[r]===u&&n[r].length>0){for(var s=0;s Date: Thu, 25 Jan 2018 07:11:23 -0600 Subject: [PATCH 14/25] update ember-cli-notifications to ^4.2.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0c39293..9554f41 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "ember-cli-htmlbars-inline-precompile": "0.3.12", "ember-cli-inject-live-reload": "^1.4.1", "ember-cli-mocha": "0.14.4", - "ember-cli-notifications": "^4.0.1", + "ember-cli-notifications": "^4.2.1", "ember-cli-shims": "^1.0.2", "ember-cli-uglify": "^1.2.0", "ember-code-snippet": "1.7.0", From 91c6d3ef15e64e61abce22796614b9e8b8bd8bc9 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Thu, 25 Jan 2018 07:12:14 -0600 Subject: [PATCH 15/25] update ember-cli-sass to 7.1.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9554f41..5ed8330 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "broccoli-merge-trees": "^2.0.0", "ember-cli-babel": "^5.1.7", "ember-cli-htmlbars": "^1.1.1", - "ember-cli-sass": "5.6.0", + "ember-cli-sass": "7.1.1", "ember-computed-decorators": "0.3.0", "ember-frost-core": "^4.0.1", "ember-hook": "1.4.2", From d749c352bf1ebfdfef689e1bdafcde2090211a01 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Thu, 25 Jan 2018 07:13:49 -0600 Subject: [PATCH 16/25] update ember-frost-core to ^5.1.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5ed8330..7a19322 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "ember-cli-htmlbars": "^1.1.1", "ember-cli-sass": "7.1.1", "ember-computed-decorators": "0.3.0", - "ember-frost-core": "^4.0.1", + "ember-frost-core": "^5.1.1", "ember-hook": "1.4.2", "ember-math-helpers": "2.0.6", "ember-prop-types": "^5.0.2", From 9f7b867a604cfcde5dc589098dc4a920f9aeca2a Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Thu, 25 Jan 2018 07:16:47 -0600 Subject: [PATCH 17/25] update ember-prop-types to ^6.0.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7a19322..4166dbd 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "ember-frost-core": "^5.1.1", "ember-hook": "1.4.2", "ember-math-helpers": "2.0.6", - "ember-prop-types": "^5.0.2", + "ember-prop-types": "^6.0.1", "ember-truth-helpers": "1.3.0", "smoke-and-mirrors": "github:ciena-frost/smoke-and-mirrors", "ua-parser-js": "^0.7.17" From 8fac4026e3f7ea5bf00d87f2833babc90c9b2727 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Thu, 25 Jan 2018 07:18:52 -0600 Subject: [PATCH 18/25] add ember-cli-frost-blueprints @ ^5.0.1 --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 4166dbd..06d19f7 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "ember-cli-chai": "0.4.3", "ember-cli-code-coverage": "0.3.12", "ember-cli-dependency-checker": "^1.3.0", + "ember-cli-frost-blueprints": "^5.0.1", "ember-cli-htmlbars-inline-precompile": "0.3.12", "ember-cli-inject-live-reload": "^1.4.1", "ember-cli-mocha": "0.14.4", From 03e92362b08546fa69b53b90b0b5c5c282dcc550 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Thu, 25 Jan 2018 07:27:33 -0600 Subject: [PATCH 19/25] remove .remarkrc lint config since linting config is now provided by ember-test-utils --- .remarkrc | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 .remarkrc diff --git a/.remarkrc b/.remarkrc deleted file mode 100644 index 9863e64..0000000 --- a/.remarkrc +++ /dev/null @@ -1,13 +0,0 @@ -{ - "plugins": { - "lint": { - "list-item-indent": false, - "maximum-line-length": false, - "no-duplicate-headings": false, - "no-multiple-toplevel-headings": false - } - }, - "settings": { - "commonmark": true - } -} From 167183d73f5dcdfe7d8cbf0f2dd30af61307a8e1 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Thu, 25 Jan 2018 07:40:58 -0600 Subject: [PATCH 20/25] updated ember-frost-sort to ^10.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 06d19f7..9e4b8e5 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "ember-data-factory-guy": "2.8.2", "ember-disable-prototype-extensions": "^1.1.0", "ember-export-application-global": "^1.0.5", - "ember-frost-sort": "^9.0.0", + "ember-frost-sort": "^10.0.0", "ember-frost-test": "^4.0.0", "ember-load-initializers": "^0.6.0", "ember-resolver": "^2.0.3", From 27062d5497c7a840fa949a885d19b70d1cdcb1c3 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Thu, 25 Jan 2018 07:51:31 -0600 Subject: [PATCH 21/25] remove unused animation-frame bower package --- bower.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bower.json b/bower.json index 7616fc9..30714d1 100644 --- a/bower.json +++ b/bower.json @@ -1,8 +1,6 @@ { "name": "ember-frost-list", - "dependencies": { - "animation-frame": "~0.2.4" - }, + "dependencies": {}, "devDependencies": { "Faker": "^3.1.0", "jquery-mockjax": "2.2.1" From e3d88cfe4c13eaeebac95cfe3e8515286059cd24 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Thu, 25 Jan 2018 09:02:22 -0600 Subject: [PATCH 22/25] udpated ember-truth-helpers to ^1.3.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9e4b8e5..7c6bbf4 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "ember-hook": "1.4.2", "ember-math-helpers": "2.0.6", "ember-prop-types": "^6.0.1", - "ember-truth-helpers": "1.3.0", + "ember-truth-helpers": "^1.3.0", "smoke-and-mirrors": "github:ciena-frost/smoke-and-mirrors", "ua-parser-js": "^0.7.17" }, From 63b124eca6524ab2efd52aae32f650e7ec52636f Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Thu, 25 Jan 2018 09:22:09 -0600 Subject: [PATCH 23/25] update call to super inside included to pass app --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 05ca225..a2fd26e 100644 --- a/index.js +++ b/index.js @@ -15,7 +15,7 @@ module.exports = { this.app = app = app.app } - this._super.included.apply(this, arguments) + this._super.included.apply(this, app) if (app) { app.import(path.join('vendor', 'ua-parser.min.js')) From 42a7bfb53ccfe8dcca896b52c15e9088e469fd19 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Thu, 25 Jan 2018 10:23:46 -0600 Subject: [PATCH 24/25] make vendor shim comply with linting --- vendor/shims/ua-parser-js.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/vendor/shims/ua-parser-js.js b/vendor/shims/ua-parser-js.js index 890f959..7538778 100644 --- a/vendor/shims/ua-parser-js.js +++ b/vendor/shims/ua-parser-js.js @@ -1,15 +1,15 @@ /* eslint-env node:true */ /* globals define, self */ -(function() { - function vendorModule() { - 'use strict'; +(function () { + function vendorModule () { + 'use strict' return { 'default': self['UAParser'], - __esModule: true, - }; + __esModule: true + } } - define('ua-parser-js', [], vendorModule); -})(); \ No newline at end of file + define('ua-parser-js', [], vendorModule) +})() From 0a3b790a72262280930056489867e723fc55d8c9 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Thu, 25 Jan 2018 10:25:33 -0600 Subject: [PATCH 25/25] updated code coverage percentage after version changes --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7c6bbf4..1c6f29e 100644 --- a/package.json +++ b/package.json @@ -85,6 +85,6 @@ "name": "frost-list" }, "pr-bumper": { - "coverage": 97.22 + "coverage": 95.84 } }