Skip to content

Commit 1ec3e12

Browse files
committed
test: Add a failing test showing the reorder problem
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.
1 parent 35d9e9a commit 1ec3e12

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

test-app/tests/plugins/column-reordering/rendering-test.gts

+22
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,28 @@ module('Plugins | columnReordering', function (hooks) {
364364
await click('.D.show');
365365
assert.strictEqual(getColumnOrder(), 'B A C D', 'all columns are visible in the correct order');
366366
});
367+
368+
test('moving past columns works works as expected', async function (assert) {
369+
assert.strictEqual(getColumnOrder(), 'A B C D', 'initially, columns exist as defined');
370+
371+
await click('.B.hide')
372+
assert.strictEqual(getColumnOrder(), 'A C D', 'column B is no longer shown, and the order of the remaining columns is retained');
373+
374+
await click('th.A .right');
375+
assert.strictEqual(getColumnOrder(), 'C A D', 'column A was moved to the right');
376+
377+
await click('.B.show');
378+
assert.strictEqual(getColumnOrder(), 'B C A D', 'column B is now shown');
379+
380+
await click('.A.hide');
381+
assert.strictEqual(getColumnOrder(), 'B C D', 'column A is hidden');
382+
383+
await click('th.D .left');
384+
assert.strictEqual(getColumnOrder(), 'B D C', 'column D was moved to the left');
385+
386+
await click('.A.show');
387+
assert.strictEqual(getColumnOrder(), 'B D C A', 'column A has returned, and it is in the right place');
388+
});
367389
});
368390

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

0 commit comments

Comments
 (0)