| 120 | |
| 121 | // Choosing commits the value, unmounts the popup's options, and restores focus. |
| 122 | const chooseOption = fixture => ({ |
| 123 | prepare: ({page}) => openPopup(page, fixture, () => page.keyboard.press('Home')), |
| 124 | spec: () => |
| 125 | press('Enter', '.list', [ |
| 126 | condition('#select-value', {text: 'item-0'}), |
| 127 | condition('[role="option"]', {count: 0}), |
| 128 | condition('#select-open', {focused: true}) |
| 129 | ]), |
| 130 | verify: async ({page}) => { |
| 131 | let label = await page.locator('#select-open [slot="label"]').textContent(); |
| 132 | if (label !== 'Record 0') { |
| 133 | throw new Error('The Select trigger does not show the chosen record.'); |
| 134 | } |
| 135 | } |
| 136 | }); |
| 137 | |
| 138 | // Keyboard drag starts from Record 0's drag button and targets drop indicators by label. |
| 139 | const insertBetween = (a, b) => `[aria-label="Insert between Record ${a} and Record ${b}"]`; |
no test coverage detected