Skip to content

Commit

Permalink
test: Add a failing test showing the reorder problem
Browse files Browse the repository at this point in the history
As described in #152, the behaviour when reordering over hidden columns
is incorrect. This test illustrates the expected behaviour so that we
can fix the implementation.
  • Loading branch information
vitch committed May 24, 2023
1 parent f594c15 commit b4e5f97
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test-app/tests/plugins/column-reordering/rendering-test.gts
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,28 @@ module('Plugins | columnReordering', function (hooks) {
await click('.D.show');
assert.strictEqual(getColumnOrder(), 'B A C D', 'all columns are visible in the correct order');
});

test('moving past hidden columns works as expected', async function (assert) {
assert.strictEqual(getColumnOrder(), 'A B C D', 'initially, columns exist as defined');

await click('.B.hide')
assert.strictEqual(getColumnOrder(), 'A C D', 'column B is no longer shown, and the order of the remaining columns is retained');

await click('th.A .right');
assert.strictEqual(getColumnOrder(), 'C A D', 'column A was moved to the right');

await click('.B.show');
assert.strictEqual(getColumnOrder(), 'B C A D', 'column B is now shown');

await click('.A.hide');
assert.strictEqual(getColumnOrder(), 'B C D', 'column A is hidden');

await click('th.D .left');
assert.strictEqual(getColumnOrder(), 'B D C', 'column D was moved to the left');

await click('.A.show');
assert.strictEqual(getColumnOrder(), 'B D C A', 'column A has returned, and it is in the right place');
});
});

module('with a preferences adapter', function (hooks) {
Expand Down

0 comments on commit b4e5f97

Please sign in to comment.