Skip to content

test(e2e): calendar page object picks a worker, not a team, in the assignee select - #8082

Merged
renemadsen merged 1 commit into
stablefrom
fix/calendar-page-object-pick-worker
Sep 18, 2026
Merged

renemadsen merged 1 commit into
stablefrom
fix/calendar-page-object-pick-worker

Conversation

@renemadsen

Copy link
Copy Markdown
Member

Prerequisite for microting/eform-backendconfiguration-plugin#1295 (part of epic microting/eform-backendconfiguration-plugin#1304).

#1295 merges teams (worker tags) into the task modal's #calendarEventAssignee select as grouped options: a Teams group first (omitted when the property has no teams), then the workers group. BackendConfigurationCalendar.page.ts picked the first option, which after #1295 would be a team.

  • New pickAssigneeWorker(workerName?): considers only options after the last .ng-optgroup header (workers); with no groups (today's plugin), every option is considered, so the current behaviour is unchanged.
  • It does not match on translated header text: the da locale renders Teams as "Hold".
  • createWeeklyEvent takes an optional workerName for an exact-label pick.

This must land before the plugin PR, because shared Page objects/ are not synced by devgetchanges.sh and plugin CI checks out frontend stable.

🤖 Generated with Claude Code

…signee select

eform-backendconfiguration-plugin#1295 merges teams (worker tags) into the
#calendarEventAssignee select as a grouped list: a "Teams" group first, then
"Medarbejdere". createWeeklyEvent picked the first `.ng-option`, which after
#1295 would be a team.

The new pickAssigneeWorker walks the flat ng-select option list in document
order and considers only options after the last group header (`.ng-optgroup`).
Workers are always the last group, and the Teams group is omitted when the
property has no teams. It matches on structure, not header text, because the
header is translated (da: "Hold"). It clicks the first enabled worker by its
id. createWeeklyEvent also takes an optional workerName to pick a worker by
exact label. Without groups (the current plugin) it still picks the first
option, as before.

This lands before #1295 because plugin CI checks out eform-angular-frontend
stable, and shared Page objects are not synced by devgetchanges.sh.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 18, 2026 16:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new assignee-picking logic can return null when no matching/enabled worker exists and then attempts to click id="null", which should be handled explicitly for clearer and more reliable test failures.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

This PR updates the Playwright E2E backend-configuration calendar page object so that calendar event creation selects a worker assignee even after backend changes that introduce grouped options (Teams first, Workers last) in #calendarEventAssignee.

Changes:

  • Added a dedicated pickAssigneeWorker(workerName?) helper that selects from options after the last .ng-optgroup header to avoid choosing a team.
  • Extended createWeeklyEvent(...) to accept an optional workerName for exact-label worker selection.
  • Updated the weekly event creation flow to use pickAssigneeWorker instead of blindly picking the first option.
File summaries
File Description
eform-client/playwright/e2e/Page objects/BackendConfigurationCalendar.page.ts Ensures assignee selection picks a worker (optionally by exact name) when the assignee dropdown contains grouped team/worker options.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +112 to +115
);
const optionId = (await handle.jsonValue()) as string;
await this.page.locator(`ng-dropdown-panel [id="${optionId}"]`).click();
}
@renemadsen
renemadsen merged commit 6f4eac9 into stable Sep 18, 2026
31 of 35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants