diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..3e391de Binary files /dev/null and b/.DS_Store differ 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 diff --git a/.remarkignore b/.remarkignore new file mode 100644 index 0000000..1b763b1 --- /dev/null +++ b/.remarkignore @@ -0,0 +1 @@ +CHANGELOG.md 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 - } -} 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 079ed63..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({ @@ -43,7 +44,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 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/bower.json b/bower.json index 22baa40..30714d1 100644 --- a/bower.json +++ b/bower.json @@ -1,8 +1,8 @@ { "name": "ember-frost-list", - "dependencies": { + "dependencies": {}, + "devDependencies": { "Faker": "^3.1.0", - "animation-frame": "~0.2.4", "jquery-mockjax": "2.2.1" } } diff --git a/ember-cli-build.js b/ember-cli-build.js index f8dda80..1211886 100644 --- a/ember-cli-build.js +++ b/ember-cli-build.js @@ -2,10 +2,7 @@ const EmberAddon = require('ember-cli/lib/broccoli/ember-addon') module.exports = function (defaults) { - var app = new EmberAddon(defaults, { - 'ember-cli-mocha': { - useLintTree: false - }, + let app = new EmberAddon(defaults, { sassOptions: { includePaths: [ ] diff --git a/index.js b/index.js index 92f41c2..a2fd26e 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', @@ -17,9 +19,11 @@ module.exports = { if (app) { app.import(path.join('vendor', 'ua-parser.min.js')) + app.import(path.join('vendor', 'shims', 'ua-parser-js.js')) } }, + /* eslint-disable complexity */ init: function (app) { this.options = this.options || {} this.options.babel = this.options.babel || {} @@ -32,5 +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 1d1c477..1c6f29e 100644 --- a/package.json +++ b/package.json @@ -32,50 +32,51 @@ "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.3.2", - "ember-cli-code-coverage": "0.3.5", + "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.13.2", - "ember-cli-notifications": "^4.0.1", + "ember-cli-mocha": "0.14.4", + "ember-cli-notifications": "^4.2.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", "ember-export-application-global": "^1.0.5", - "ember-frost-sort": "^9.0.0", - "ember-frost-test": "1.0.1", + "ember-frost-sort": "^10.0.0", + "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", "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", + "ember-cli-sass": "7.1.1", "ember-computed-decorators": "0.3.0", - "ember-frost-core": "^4.0.1", - "ember-hook": "^1.4.2", + "ember-frost-core": "^5.1.1", + "ember-hook": "1.4.2", "ember-math-helpers": "2.0.6", - "ember-prop-types": "^5.0.2", - "ember-truth-helpers": "1.3.0", + "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.12" + "ua-parser-js": "^0.7.17" }, "ember-addon": { "configPath": "tests/dummy/config" @@ -84,6 +85,6 @@ "name": "frost-list" }, "pr-bumper": { - "coverage": 97.22 + "coverage": 95.84 } -} \ No newline at end of file +} 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/config/coverage.js b/tests/dummy/config/coverage.js similarity index 100% rename from config/coverage.js rename to tests/dummy/config/coverage.js 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) }) }) diff --git a/vendor/shims/ua-parser-js.js b/vendor/shims/ua-parser-js.js new file mode 100644 index 0000000..7538778 --- /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) +})() 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