Skip to content

Commit 8ac9d1d

Browse files
authored
Merge pull request #124 from bertdeblock/enable-skipped-listbox-tests-again
Enable skipped listbox tests again
2 parents def91a1 + 65e5c1e commit 8ac9d1d

File tree

1 file changed

+34
-68
lines changed

1 file changed

+34
-68
lines changed

tests/integration/components/listbox-test.js

Lines changed: 34 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ module('Integration | Component | <Listbox>', function (hooks) {
104104
});
105105

106106
module('<listbox.Label>', () => {
107-
// https://github.com/GavinJoyce/ember-headlessui/issues/113
108-
skip('should be possible to render a <listbox.Label> using yielded props', async function () {
107+
test('should be possible to render a <listbox.Label> using yielded props', async function () {
109108
await render(hbs`
110109
<Listbox as |listbox|>
111110
<listbox.Label data-test="headlessui-listbox-label-1">{{listbox.isOpen}} {{listbox.disabled}}</listbox.Label>
@@ -251,8 +250,7 @@ module('Integration | Component | <Listbox>', function (hooks) {
251250
});
252251

253252
module('<listbox.Options>', () => {
254-
// https://github.com/GavinJoyce/ember-headlessui/issues/113
255-
skip('should be possible to render a <listbox.Options> using yielded props', async function () {
253+
test('should be possible to render a <listbox.Options> using yielded props', async function () {
256254
await render(hbs`
257255
<Listbox as |listbox|>
258256
<listbox.Button data-test="headlessui-listbox-button-1">Trigger</listbox.Button>
@@ -446,8 +444,7 @@ module('Integration | Component | <Listbox>', function (hooks) {
446444
});
447445

448446
module('Listbox keyboard actions', () => {
449-
// https://github.com/GavinJoyce/ember-headlessui/issues/113
450-
skip('`Enter` key', async function (assert) {
447+
test('`Enter` key', async function (assert) {
451448
await render(hbs`
452449
<Listbox as |listbox|>
453450
<listbox.Button data-test="headlessui-listbox-button-1">Trigger</listbox.Button>
@@ -497,8 +494,7 @@ module('Integration | Component | <Listbox>', function (hooks) {
497494
assertNoSelectedListboxOption();
498495
});
499496

500-
// https://github.com/GavinJoyce/ember-headlessui/issues/113
501-
skip('should not be possible to open the listbox with Enter when the button is disabled', async function () {
497+
test('should not be possible to open the listbox with Enter when the button is disabled', async function () {
502498
await render(hbs`
503499
<Listbox @disabled={{true}} as |listbox|>
504500
<listbox.Button data-test="headlessui-listbox-button-1">Trigger</listbox.Button>
@@ -536,8 +532,7 @@ module('Integration | Component | <Listbox>', function (hooks) {
536532
assertListbox({ state: ListboxState.InvisibleUnmounted });
537533
});
538534

539-
// https://github.com/GavinJoyce/ember-headlessui/issues/113
540-
skip('should be possible to open the listbox with Enter, and focus the selected option', async function (assert) {
535+
test('should be possible to open the listbox with Enter, and focus the selected option', async function (assert) {
541536
await render(hbs`
542537
<Listbox @value="b" as |listbox|>
543538
<listbox.Button data-test="headlessui-listbox-button-1">Trigger</listbox.Button>
@@ -592,8 +587,7 @@ module('Integration | Component | <Listbox>', function (hooks) {
592587
async () => {}
593588
);
594589

595-
// https://github.com/GavinJoyce/ember-headlessui/issues/113
596-
skip('should be possible to open the listbox with Enter, and focus the selected option (with a list of objects)', async function (assert) {
590+
test('should be possible to open the listbox with Enter, and focus the selected option (with a list of objects)', async function (assert) {
597591
this.set('myOptions', [
598592
{ id: 'a', name: 'Option A' },
599593
{ id: 'b', name: 'Option B' },
@@ -645,8 +639,7 @@ module('Integration | Component | <Listbox>', function (hooks) {
645639
assertActiveListboxOption(options[1]);
646640
});
647641

648-
// https://github.com/GavinJoyce/ember-headlessui/issues/113
649-
skip('should have no active listbox option when there are no listbox options at all', async function () {
642+
test('should have no active listbox option when there are no listbox options at all', async function () {
650643
await render(hbs`
651644
<Listbox @value={{this.selectedOption}} as |listbox|>
652645
<listbox.Button data-test="headlessui-listbox-button-1">Trigger</listbox.Button>
@@ -739,8 +732,7 @@ module('Integration | Component | <Listbox>', function (hooks) {
739732
assertActiveListboxOption(options[2]);
740733
});
741734

742-
// https://github.com/GavinJoyce/ember-headlessui/issues/113
743-
skip('should have no active listbox option upon Enter key press, when there are no non-disabled listbox options', async function () {
735+
test('should have no active listbox option upon Enter key press, when there are no non-disabled listbox options', async function () {
744736
await render(hbs`
745737
<Listbox as |listbox|>
746738
<listbox.Button data-test="headlessui-listbox-button-1">Trigger</listbox.Button>
@@ -773,8 +765,7 @@ module('Integration | Component | <Listbox>', function (hooks) {
773765
assertNoActiveListboxOption();
774766
});
775767

776-
// https://github.com/GavinJoyce/ember-headlessui/issues/113
777-
skip('should be possible to close the listbox with Enter when there is no active listboxoption', async function () {
768+
test('should be possible to close the listbox with Enter when there is no active listboxoption', async function () {
778769
await render(hbs`
779770
<Listbox as |listbox|>
780771
<listbox.Button data-test="headlessui-listbox-button-1">Trigger</listbox.Button>
@@ -815,8 +806,7 @@ module('Integration | Component | <Listbox>', function (hooks) {
815806
await assertActiveElement(getListboxButton());
816807
});
817808

818-
// https://github.com/GavinJoyce/ember-headlessui/issues/113
819-
skip('should be possible to close the listbox with Enter and choose the active listbox option', async function (assert) {
809+
test('should be possible to close the listbox with Enter and choose the active listbox option', async function (assert) {
820810
let callValue = '',
821811
callCount = 0;
822812

@@ -882,8 +872,7 @@ module('Integration | Component | <Listbox>', function (hooks) {
882872
});
883873

884874
module('Listbox `Space` key', () => {
885-
// https://github.com/GavinJoyce/ember-headlessui/issues/113
886-
skip('should be possible to open the listbox with Space', async function (assert) {
875+
test('should be possible to open the listbox with Space', async function (assert) {
887876
await render(hbs`
888877
<Listbox as |listbox|>
889878
<listbox.Button data-test="headlessui-listbox-button-1">Trigger</listbox.Button>
@@ -966,8 +955,7 @@ module('Integration | Component | <Listbox>', function (hooks) {
966955
assertListbox({ state: ListboxState.InvisibleUnmounted });
967956
});
968957

969-
// https://github.com/GavinJoyce/ember-headlessui/issues/113
970-
skip('should be possible to open the listbox with Space, and focus the selected option', async function (assert) {
958+
test('should be possible to open the listbox with Space, and focus the selected option', async function (assert) {
971959
await render(hbs`
972960
<Listbox @value="b" as |listbox|>
973961
<listbox.Button data-test="headlessui-listbox-button-1">Trigger</listbox.Button>
@@ -1017,8 +1005,7 @@ module('Integration | Component | <Listbox>', function (hooks) {
10171005
assertActiveListboxOption(options[1]);
10181006
});
10191007

1020-
// https://github.com/GavinJoyce/ember-headlessui/issues/113
1021-
skip('should have no active listbox option when there are no listbox options at all', async function () {
1008+
test('should have no active listbox option when there are no listbox options at all', async function () {
10221009
await render(hbs`
10231010
<Listbox as |listbox|>
10241011
<listbox.Button data-test="headlessui-listbox-button-1">Trigger</listbox.Button>
@@ -1144,8 +1131,7 @@ module('Integration | Component | <Listbox>', function (hooks) {
11441131
assertNoActiveListboxOption();
11451132
});
11461133

1147-
// https://github.com/GavinJoyce/ember-headlessui/issues/113
1148-
skip('should be possible to close the listbox with Space and choose the active listbox option', async function (assert) {
1134+
test('should be possible to close the listbox with Space and choose the active listbox option', async function (assert) {
11491135
let callValue = '',
11501136
callCount = 0;
11511137

@@ -1205,8 +1191,7 @@ module('Integration | Component | <Listbox>', function (hooks) {
12051191
});
12061192

12071193
module('Listbox `Escape` key', () => {
1208-
// https://github.com/GavinJoyce/ember-headlessui/issues/113
1209-
skip('should be possible to close an open listbox with Escape', async function () {
1194+
test('should be possible to close an open listbox with Escape', async function () {
12101195
await render(hbs`
12111196
<Listbox as |listbox|>
12121197
<listbox.Button data-test="headlessui-listbox-button-1">Trigger</listbox.Button>
@@ -1252,8 +1237,7 @@ module('Integration | Component | <Listbox>', function (hooks) {
12521237
});
12531238

12541239
module('Listbox `Tab` key', () => {
1255-
// https://github.com/GavinJoyce/ember-headlessui/issues/113
1256-
skip('should focus trap when we use Tab', async function (assert) {
1240+
test('should focus trap when we use Tab', async function (assert) {
12571241
await render(hbs`
12581242
<Listbox as |listbox|>
12591243
<listbox.Button data-test="headlessui-listbox-button-1">Trigger</listbox.Button>
@@ -1307,8 +1291,7 @@ module('Integration | Component | <Listbox>', function (hooks) {
13071291
await assertActiveElement(getListbox());
13081292
});
13091293

1310-
// https://github.com/GavinJoyce/ember-headlessui/issues/113
1311-
skip('should focus trap when we use Shift+Tab', async function (assert) {
1294+
test('should focus trap when we use Shift+Tab', async function (assert) {
13121295
await render(hbs`
13131296
<Listbox as |listbox|>
13141297
<listbox.Button data-test="headlessui-listbox-button-1">Trigger</listbox.Button>
@@ -1366,8 +1349,7 @@ module('Integration | Component | <Listbox>', function (hooks) {
13661349
});
13671350

13681351
module('Listbox `ArrowDown` key', () => {
1369-
// https://github.com/GavinJoyce/ember-headlessui/issues/113
1370-
skip('should be possible to open the listbox with ArrowDown', async function (assert) {
1352+
test('should be possible to open the listbox with ArrowDown', async function (assert) {
13711353
await render(hbs`
13721354
<Listbox as |listbox|>
13731355
<listbox.Button data-test="headlessui-listbox-button-1">Trigger</listbox.Button>
@@ -1595,8 +1577,7 @@ module('Integration | Component | <Listbox>', function (hooks) {
15951577
});
15961578

15971579
module('Listbox `ArrowUp` key', () => {
1598-
// https://github.com/GavinJoyce/ember-headlessui/issues/113
1599-
skip('should be possible to open the listbox with ArrowUp and the last option should be active', async function (assert) {
1580+
test('should be possible to open the listbox with ArrowUp and the last option should be active', async function (assert) {
16001581
await render(hbs`
16011582
<Listbox as |listbox|>
16021583
<listbox.Button data-test="headlessui-listbox-button-1">Trigger</listbox.Button>
@@ -1682,8 +1663,7 @@ module('Integration | Component | <Listbox>', function (hooks) {
16821663
assertListbox({ state: ListboxState.InvisibleUnmounted });
16831664
});
16841665

1685-
// https://github.com/GavinJoyce/ember-headlessui/issues/113
1686-
skip('should be possible to open the listbox with ArrowUp, and focus the selected option', async function (assert) {
1666+
test('should be possible to open the listbox with ArrowUp, and focus the selected option', async function (assert) {
16871667
await render(hbs`
16881668
<Listbox @value="b" as |listbox|>
16891669
<listbox.Button data-test="headlessui-listbox-button-1">Trigger</listbox.Button>
@@ -1733,8 +1713,7 @@ module('Integration | Component | <Listbox>', function (hooks) {
17331713
assertActiveListboxOption(options[1]);
17341714
});
17351715

1736-
// https://github.com/GavinJoyce/ember-headlessui/issues/113
1737-
skip('should have no active listbox option when there are no listbox options at all', async function () {
1716+
test('should have no active listbox option when there are no listbox options at all', async function () {
17381717
await render(hbs`
17391718
<Listbox as |listbox|>
17401719
<listbox.Button data-test="headlessui-listbox-button-1">Trigger</listbox.Button>
@@ -1755,8 +1734,7 @@ module('Integration | Component | <Listbox>', function (hooks) {
17551734
assertNoActiveListboxOption();
17561735
});
17571736

1758-
// https://github.com/GavinJoyce/ember-headlessui/issues/113
1759-
skip('should be possible to use ArrowUp to navigate the listbox options and jump to the first non-disabled one', async function (assert) {
1737+
test('should be possible to use ArrowUp to navigate the listbox options and jump to the first non-disabled one', async function (assert) {
17601738
await render(hbs`
17611739
<Listbox as |listbox|>
17621740
<listbox.Button data-test="headlessui-listbox-button-1">Trigger</listbox.Button>
@@ -1838,8 +1816,7 @@ module('Integration | Component | <Listbox>', function (hooks) {
18381816
assertActiveListboxOption(options[2]);
18391817
});
18401818

1841-
// https://github.com/GavinJoyce/ember-headlessui/issues/113
1842-
skip('should be possible to use ArrowUp to navigate the listbox options', async function (assert) {
1819+
test('should be possible to use ArrowUp to navigate the listbox options', async function (assert) {
18431820
await render(hbs`
18441821
<Listbox as |listbox|>
18451822
<listbox.Button data-test="headlessui-listbox-button-1">Trigger</listbox.Button>
@@ -1899,8 +1876,7 @@ module('Integration | Component | <Listbox>', function (hooks) {
18991876
});
19001877

19011878
module('Listbox `ArrowLeft` key', () => {
1902-
// https://github.com/GavinJoyce/ember-headlessui/issues/113
1903-
skip('should be possible to use ArrowLeft to navigate the listbox options', async function (assert) {
1879+
test('should be possible to use ArrowLeft to navigate the listbox options', async function (assert) {
19041880
await render(hbs`
19051881
<Listbox as |listbox|>
19061882
<listbox.Button data-test="headlessui-listbox-button-1">Trigger</listbox.Button>
@@ -2683,8 +2659,7 @@ module('Integration | Component | <Listbox>', function (hooks) {
26832659
});
26842660

26852661
module('listbox mouse interactions', () => {
2686-
// https://github.com/GavinJoyce/ember-headlessui/issues/113
2687-
skip('should focus the Listbox.Button when we click the Listbox.Label', async function () {
2662+
test('should focus the Listbox.Button when we click the Listbox.Label', async function () {
26882663
await render(hbs`
26892664
<Listbox as |listbox|>
26902665
<listbox.Label>Label</listbox.Label>
@@ -2707,8 +2682,7 @@ module('Integration | Component | <Listbox>', function (hooks) {
27072682
await assertActiveElement(getListboxButton());
27082683
});
27092684

2710-
// https://github.com/GavinJoyce/ember-headlessui/issues/113
2711-
skip('should not focus the Listbox.Button when we right click the Listbox.Label', async function () {
2685+
test('should not focus the Listbox.Button when we right click the Listbox.Label', async function () {
27122686
await render(hbs`
27132687
<Listbox as |listbox|>
27142688
<listbox.Label>Label</listbox.Label>
@@ -2731,8 +2705,7 @@ module('Integration | Component | <Listbox>', function (hooks) {
27312705
await assertActiveElement(document.body);
27322706
});
27332707

2734-
// https://github.com/GavinJoyce/ember-headlessui/issues/113
2735-
skip('should be possible to open the listbox on click', async function (assert) {
2708+
test('should be possible to open the listbox on click', async function (assert) {
27362709
await render(hbs`
27372710
<Listbox as |listbox|>
27382711
<listbox.Button data-test="headlessui-listbox-button-1">Trigger</listbox.Button>
@@ -2826,8 +2799,7 @@ module('Integration | Component | <Listbox>', function (hooks) {
28262799
assertListbox({ state: ListboxState.InvisibleUnmounted });
28272800
});
28282801

2829-
// https://github.com/GavinJoyce/ember-headlessui/issues/113
2830-
skip('should be possible to open the listbox on click, and focus the selected option', async function (assert) {
2802+
test('should be possible to open the listbox on click, and focus the selected option', async function (assert) {
28312803
await render(hbs`
28322804
<Listbox @value="b" as |listbox|>
28332805
<listbox.Button data-test="headlessui-listbox-button-1">Trigger</listbox.Button>
@@ -2916,8 +2888,7 @@ module('Integration | Component | <Listbox>', function (hooks) {
29162888
assertListbox({ state: ListboxState.InvisibleUnmounted });
29172889
});
29182890

2919-
// https://github.com/GavinJoyce/ember-headlessui/issues/113
2920-
skip('should be possible to click outside of the listbox which should close the listbox', async function () {
2891+
test('should be possible to click outside of the listbox which should close the listbox', async function () {
29212892
await render(hbs`
29222893
<Listbox as |listbox|>
29232894
<listbox.Button data-test="headlessui-listbox-button-1">Trigger</listbox.Button>
@@ -2984,8 +2955,7 @@ module('Integration | Component | <Listbox>', function (hooks) {
29842955
assertListboxButtonLinkedWithListbox(button2, getListbox());
29852956
});
29862957

2987-
// https://github.com/GavinJoyce/ember-headlessui/issues/113
2988-
skip('should be possible to click outside of the listbox which should close the listbox (even if we press the listbox button)', async function () {
2958+
test('should be possible to click outside of the listbox which should close the listbox (even if we press the listbox button)', async function () {
29892959
await render(hbs`
29902960
<Listbox as |listbox|>
29912961
<listbox.Button data-test="headlessui-listbox-button-1">Trigger</listbox.Button>
@@ -3275,8 +3245,7 @@ module('Integration | Component | <Listbox>', function (hooks) {
32753245
assertNoActiveListboxOption();
32763246
});
32773247

3278-
// https://github.com/GavinJoyce/ember-headlessui/issues/113
3279-
skip('should be possible to click a listbox option, which closes the listbox', async function (assert) {
3248+
test('should be possible to click a listbox option, which closes the listbox', async function (assert) {
32803249
let callValue = '',
32813250
callCount = 0;
32823251

@@ -3320,8 +3289,7 @@ module('Integration | Component | <Listbox>', function (hooks) {
33203289
assertActiveListboxOption(getListboxOptions()[1]);
33213290
});
33223291

3323-
// https://github.com/GavinJoyce/ember-headlessui/issues/113
3324-
skip('should be possible to click a disabled listbox option, which is a no-op', async function (assert) {
3292+
test('should be possible to click a disabled listbox option, which is a no-op', async function (assert) {
33253293
let callCount = 0;
33263294

33273295
this.set('onChange', (value) => {
@@ -3363,8 +3331,7 @@ module('Integration | Component | <Listbox>', function (hooks) {
33633331
assertNoActiveListboxOption();
33643332
});
33653333

3366-
// https://github.com/GavinJoyce/ember-headlessui/issues/113
3367-
skip('should be possible focus a listbox option, so that it becomes active', async function () {
3334+
test('should be possible focus a listbox option, so that it becomes active', async function () {
33683335
await render(hbs`
33693336
<Listbox as |listbox|>
33703337
<listbox.Button data-test="headlessui-listbox-button-1">Trigger</listbox.Button>
@@ -3391,8 +3358,7 @@ module('Integration | Component | <Listbox>', function (hooks) {
33913358
assertActiveListboxOption(options[1]);
33923359
});
33933360

3394-
// https://github.com/GavinJoyce/ember-headlessui/issues/113
3395-
skip('should not be possible to focus a listbox option which is disabled', async function () {
3361+
test('should not be possible to focus a listbox option which is disabled', async function () {
33963362
await render(hbs`
33973363
<Listbox as |listbox|>
33983364
<listbox.Button data-test="headlessui-listbox-button-1">Trigger</listbox.Button>

0 commit comments

Comments
 (0)