@iblai/iblai-js 1.20.11 → 1.20.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -50,6 +50,8 @@ export declare const TASKS_LABELS: {
50
50
  readonly empty: "No tasks scheduled.";
51
51
  };
52
52
  readonly scheduleDialog: {
53
+ /** `aria-label` on the dialog's `DialogContent` — scopes in-dialog locators. */
54
+ readonly dialogName: "schedule-task";
53
55
  readonly taskName: "Task Name";
54
56
  readonly taskNamePlaceholder: "Enter task name";
55
57
  readonly taskPrompt: "Task Prompt";
@@ -125,6 +127,12 @@ export declare function selectTaskInList(scope: Page | Locator, taskName: string
125
127
  export declare function expectTaskStatus(scope: Page | Locator, taskName: string, status: TaskStatus): Promise<void>;
126
128
  /** Type into the search input. Returns once the input value matches. */
127
129
  export declare function searchTasks(scope: Page | Locator, query: string): Promise<void>;
130
+ /**
131
+ * Locator for the Schedule Task dialog itself. Scoping in-dialog queries to
132
+ * this avoids clashing with the toolbar's "Schedule Task" button, which
133
+ * shares an accessible name with the dialog's submit button.
134
+ */
135
+ export declare function getScheduleTaskDialog(scope: Page | Locator): Locator;
128
136
  /** Open the Schedule Task dialog and wait for it to be interactive. */
129
137
  export declare function openScheduleTaskDialog(scope: Page | Locator): Promise<void>;
130
138
  /**
@@ -4267,6 +4267,8 @@ const TASKS_LABELS = {
4267
4267
  empty: 'No tasks scheduled.',
4268
4268
  },
4269
4269
  scheduleDialog: {
4270
+ /** `aria-label` on the dialog's `DialogContent` — scopes in-dialog locators. */
4271
+ dialogName: 'schedule-task',
4270
4272
  taskName: 'Task Name',
4271
4273
  taskNamePlaceholder: 'Enter task name',
4272
4274
  taskPrompt: 'Task Prompt',
@@ -4407,11 +4409,18 @@ async function searchTasks(scope, query) {
4407
4409
  await test$1.expect(input).toHaveValue(query);
4408
4410
  }
4409
4411
  // ── Schedule flow ──────────────────────────────────────────────────────
4412
+ /**
4413
+ * Locator for the Schedule Task dialog itself. Scoping in-dialog queries to
4414
+ * this avoids clashing with the toolbar's "Schedule Task" button, which
4415
+ * shares an accessible name with the dialog's submit button.
4416
+ */
4417
+ function getScheduleTaskDialog(scope) {
4418
+ return asPage(scope).getByRole('dialog', { name: TASKS_LABELS.scheduleDialog.dialogName });
4419
+ }
4410
4420
  /** Open the Schedule Task dialog and wait for it to be interactive. */
4411
4421
  async function openScheduleTaskDialog(scope) {
4412
4422
  await getScheduleTaskButton(scope).click();
4413
- const page = asPage(scope);
4414
- await test$1.expect(page.getByLabel(TASKS_LABELS.scheduleDialog.taskName)).toBeVisible({
4423
+ await test$1.expect(getScheduleTaskDialog(scope).getByLabel(TASKS_LABELS.scheduleDialog.taskName)).toBeVisible({
4415
4424
  timeout: 10000,
4416
4425
  });
4417
4426
  }
@@ -4426,11 +4435,15 @@ async function openScheduleTaskDialog(scope) {
4426
4435
  async function scheduleTask(scope, opts) {
4427
4436
  await openScheduleTaskDialog(scope);
4428
4437
  const page = asPage(scope);
4429
- await page.getByLabel(TASKS_LABELS.scheduleDialog.taskName).fill(opts.name);
4438
+ // Scope every query to the dialog: the toolbar "Schedule Task" button shares
4439
+ // an accessible name with the dialog's submit button, so an unscoped
4440
+ // getByRole('button', { name: 'Schedule Task' }) matches two elements.
4441
+ const dialog = getScheduleTaskDialog(scope);
4442
+ await dialog.getByLabel(TASKS_LABELS.scheduleDialog.taskName).fill(opts.name);
4430
4443
  if (opts.prompt !== undefined) {
4431
- await page.getByLabel(TASKS_LABELS.scheduleDialog.taskPrompt).fill(opts.prompt);
4444
+ await dialog.getByLabel(TASKS_LABELS.scheduleDialog.taskPrompt).fill(opts.prompt);
4432
4445
  }
4433
- await page.getByLabel(TASKS_LABELS.scheduleDialog.time).fill(opts.time);
4446
+ await dialog.getByLabel(TASKS_LABELS.scheduleDialog.time).fill(opts.time);
4434
4447
  if (opts.repeat) {
4435
4448
  // The repeat <Select> renders as a combobox via Radix.
4436
4449
  const repeatLabel = {
@@ -4439,16 +4452,17 @@ async function scheduleTask(scope, opts) {
4439
4452
  weekly: TASKS_LABELS.scheduleDialog.weekly,
4440
4453
  monthly: TASKS_LABELS.scheduleDialog.monthly,
4441
4454
  }[opts.repeat];
4442
- await page.getByLabel(TASKS_LABELS.scheduleDialog.repeat).click();
4455
+ await dialog.getByLabel(TASKS_LABELS.scheduleDialog.repeat).click();
4456
+ // Radix renders the option list in a portal outside the dialog subtree.
4443
4457
  await page.getByRole('option', { name: repeatLabel }).click();
4444
4458
  }
4445
4459
  if (opts.notifyByEmail) {
4446
- await page.getByLabel(TASKS_LABELS.scheduleDialog.notifyByEmail).click();
4460
+ await dialog.getByLabel(TASKS_LABELS.scheduleDialog.notifyByEmail).click();
4447
4461
  }
4448
- const submit = page.getByRole('button', { name: TASKS_LABELS.scheduleDialog.schedule });
4462
+ const submit = dialog.getByRole('button', { name: TASKS_LABELS.scheduleDialog.schedule });
4449
4463
  await test$1.expect(submit).toBeEnabled({ timeout: 5000 });
4450
4464
  await submit.click();
4451
- await test$1.expect(page.getByLabel(TASKS_LABELS.scheduleDialog.taskName)).toBeHidden({
4465
+ await test$1.expect(dialog).toBeHidden({
4452
4466
  timeout: 15000,
4453
4467
  });
4454
4468
  logger.info(`Scheduled task: ${opts.name}`);