Skip to content

Commit bc9d672

Browse files
committed
cleaning up tests
1 parent e2b487d commit bc9d672

1 file changed

Lines changed: 0 additions & 77 deletions

File tree

showcase/tests/integration/components/hds/advanced-table/features/column-resizing-test.gts

Lines changed: 0 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -457,83 +457,6 @@ module('Integration | Component | hds/advanced-table/index', function (hooks) {
457457
);
458458
});
459459

460-
test('a resize leaves untouched columns and explicit pixel widths alone', async function (assert) {
461-
await render(
462-
<template>
463-
<div {{style width="1000px"}}>
464-
<HdsAdvancedTable
465-
id="mixed-table"
466-
@columns={{array
467-
(hash key="a" label="A")
468-
(hash key="b" label="B" width="350px")
469-
(hash key="c" label="C")
470-
(hash key="d" label="D")
471-
}}
472-
@model={{array
473-
(hash a="a1" b="b1" c="c1" d="d1")
474-
(hash a="a2" b="b2" c="c2" d="d2")
475-
}}
476-
@hasResizableColumns={{true}}
477-
>
478-
<:body as |B|>
479-
<B.Tr>
480-
<B.Td>{{get B.data "a"}}</B.Td>
481-
<B.Td>{{get B.data "b"}}</B.Td>
482-
<B.Td>{{get B.data "c"}}</B.Td>
483-
<B.Td>{{get B.data "d"}}</B.Td>
484-
</B.Tr>
485-
</:body>
486-
</HdsAdvancedTable>
487-
</div>
488-
</template>,
489-
);
490-
491-
await waitForLayout();
492-
493-
const widths = () =>
494-
[0, 1, 2, 3].map((index) => columnWidth('#mixed-table', index));
495-
const originalWidths = widths();
496-
497-
await simulatePointerDrag(
498-
findOrThrow('#mixed-table .hds-advanced-table__th-resize-handle'),
499-
200,
500-
);
501-
502-
const afterDrag = widths();
503-
504-
assert.ok(
505-
afterDrag[0]! > originalWidths[0]! &&
506-
afterDrag[1]! < originalWidths[1]!,
507-
`col1 grew and col2 shrank (${JSON.stringify(originalWidths)} -> ${JSON.stringify(afterDrag)})`,
508-
);
509-
assert.deepEqual(
510-
[afterDrag[2], afterDrag[3]],
511-
[originalWidths[2], originalWidths[3]],
512-
'col3 and col4 were untouched by the drag',
513-
);
514-
515-
await performContextMenuAction(
516-
findAtOrThrow('#mixed-table .hds-advanced-table__th', 0),
517-
'reset-column-width',
518-
);
519-
await waitForLayout();
520-
521-
const finalWidths = widths();
522-
523-
// col1 goes back to a flexible track, so it lands on the same share as the
524-
// two untouched flexible columns
525-
assert.ok(
526-
Math.abs(finalWidths[0]! - finalWidths[2]!) <= 1 &&
527-
Math.abs(finalWidths[0]! - finalWidths[3]!) <= 1,
528-
`col1 returned to an equal share with the other flexible columns (${JSON.stringify(finalWidths)})`,
529-
);
530-
assert.strictEqual(
531-
finalWidths[1],
532-
afterDrag[1],
533-
'col2 kept the explicit width the drag left it at',
534-
);
535-
});
536-
537460
test('resetting a column width is idempotent', async function (assert) {
538461
await render(
539462
<template>

0 commit comments

Comments
 (0)