From db1ed14acf42743cee0cd980eefdb10ba3a204a8 Mon Sep 17 00:00:00 2001 From: John Cowen Date: Wed, 10 Jun 2020 14:27:21 +0100 Subject: [PATCH] ui: remove sort-control component (#8077) This was never actually used --- ui-v2/app/components/sort-control/index.hbs | 7 --- ui-v2/app/components/sort-control/index.js | 15 ------ .../components/sort-control-test.js | 47 ------------------- 3 files changed, 69 deletions(-) delete mode 100644 ui-v2/app/components/sort-control/index.hbs delete mode 100644 ui-v2/app/components/sort-control/index.js delete mode 100644 ui-v2/tests/integration/components/sort-control-test.js diff --git a/ui-v2/app/components/sort-control/index.hbs b/ui-v2/app/components/sort-control/index.hbs deleted file mode 100644 index 31a9556362..0000000000 --- a/ui-v2/app/components/sort-control/index.hbs +++ /dev/null @@ -1,7 +0,0 @@ - -{{#if checked}} - -{{/if}} - \ No newline at end of file diff --git a/ui-v2/app/components/sort-control/index.js b/ui-v2/app/components/sort-control/index.js deleted file mode 100644 index af6e69eb96..0000000000 --- a/ui-v2/app/components/sort-control/index.js +++ /dev/null @@ -1,15 +0,0 @@ -import Component from '@ember/component'; -import { set } from '@ember/object'; -export default Component.extend({ - classNames: ['sort-control'], - direction: 'asc', - onchange: function() {}, - actions: { - change: function(e) { - if (e.target.type === 'checkbox') { - set(this, 'direction', e.target.checked ? 'desc' : 'asc'); - } - this.onchange({ target: { value: `${this.value}:${this.direction}` } }); - }, - }, -}); diff --git a/ui-v2/tests/integration/components/sort-control-test.js b/ui-v2/tests/integration/components/sort-control-test.js deleted file mode 100644 index fd337e3875..0000000000 --- a/ui-v2/tests/integration/components/sort-control-test.js +++ /dev/null @@ -1,47 +0,0 @@ -import { module, test } from 'qunit'; -import { setupRenderingTest } from 'ember-qunit'; -import { render } from '@ember/test-helpers'; -import hbs from 'htmlbars-inline-precompile'; - -module('Integration | Component | sort control', function(hooks) { - setupRenderingTest(hooks); - - hooks.beforeEach(function() { - this.actions = {}; - this.send = (actionName, ...args) => this.actions[actionName].apply(this, args); - }); - - test('it renders', async function(assert) { - // Set any properties with this.set('myProperty', 'value'); - // Handle any actions with this.on('myAction', function(val) { ... }); - - await render(hbs`{{sort-control}}`); - - assert.dom('*').hasText(''); - - // Template block usage: - await render(hbs` - {{#sort-control}} - template block text - {{/sort-control}} - `); - - assert.dom('*').hasText('template block text'); - }); - test('it changes direction and calls onchange when clicked/activated', async function(assert) { - assert.expect(2); - let count = 0; - this.actions.change = e => { - if (count === 0) { - assert.equal(e.target.value, 'sort:desc'); - } else { - assert.equal(e.target.value, 'sort:asc'); - } - count++; - }; - await render(hbs`{{sort-control checked=true value='sort' onchange=(action 'change')}}`); - const $label = this.$('label'); - $label.trigger('click'); - $label.trigger('click'); - }); -});