diff --git a/tests/unit/array/sort-test.js b/tests/unit/array/sort-test.js deleted file mode 100644 index 9e31d39..0000000 --- a/tests/unit/array/sort-test.js +++ /dev/null @@ -1,83 +0,0 @@ -import { sort } from 'ember-awesome-macros/array'; -import { raw } from 'ember-awesome-macros'; -import { module, skip, test } from 'qunit'; -import compute from 'ember-macro-test-helpers/compute'; - -let array; - -module('Unit | Macro | array | sort', { - beforeEach() { - array = [1, 3, 2]; - } -}); - -skip('it returns an empty array if array undefined', function(assert) { - compute({ - assert, - computed: sort('array'), - deepEqual: [] - }); -}); - -test('it returns an undefined if array undefined', function(assert) { - compute({ - assert, - computed: sort('array'), - strictEqual: undefined - }); -}); - -test('it returns a sorted array', function(assert) { - compute({ - assert, - computed: sort('array'), - properties: { - array - }, - deepEqual: [1, 2, 3] - }); -}); - -test('it returns an array sorted by property', function(assert) { - compute({ - assert, - computed: sort('array', ['prop:desc']), - properties: { - array: [{prop: 1}, {prop: 3}, {prop: 2}] - }, - deepEqual: [{prop: 3}, {prop: 2}, {prop: 1}] - }); -}); - -test('it does not sort the source array for default sorts', function(assert) { - compute({ - assert, - computed: sort('array'), - properties: { - array - }, - deepEqual: [1, 2, 3] - }); - assert.deepEqual(array, [1, 3, 2]); -}); - -test('it does not sort the source array for property sorts', function(assert) { - let array = [{prop: 1}, {prop: 3}, {prop: 2}]; - compute({ - assert, - computed: sort('array', ['prop:desc']), - properties: { - array - }, - deepEqual: [{prop: 3}, {prop: 2}, {prop: 1}] - }); - assert.deepEqual(array, [{prop: 1}, {prop: 3}, {prop: 2}]); -}); - -test('composable: it returns a sorted array', function(assert) { - compute({ - assert, - computed: sort(raw(array)), - deepEqual: [1, 2, 3] - }); -});