Skip to content

Commit 507a51b

Browse files
committed
fix(app): restore question pager segments
1 parent 45cd8d7 commit 507a51b

2 files changed

Lines changed: 36 additions & 1 deletion

File tree

packages/app/e2e/regression/session-request-docks.spec.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,41 @@ test("shows a pending question dock", async ({ page }) => {
7070
expect((await reply).postDataJSON()).toEqual({ answers: [["Minimal"]] })
7171
})
7272

73+
test("shows every question in the question pager", async ({ page }) => {
74+
await mockServer(page, {
75+
questions: [
76+
{
77+
id: "question-request",
78+
sessionID,
79+
questions: Array.from({ length: 4 }, (_, index) => ({
80+
header: `Question ${index + 1}`,
81+
question: `Question ${index + 1}?`,
82+
options: [{ label: "Yes", description: "Continue" }],
83+
})),
84+
},
85+
],
86+
})
87+
88+
await page.goto(`/${base64Encode(directory)}/session/${sessionID}`)
89+
await expectSessionTitle(page, title)
90+
91+
const question = page.locator('[data-component="dock-prompt"][data-kind="question"]')
92+
const segments = question.locator('[data-slot="question-progress-segment"]')
93+
await expect(segments).toHaveCount(4)
94+
await expect
95+
.poll(() =>
96+
segments.nth(1).evaluate((element) => ({
97+
segment: getComputedStyle(element, "::after").backgroundColor,
98+
expected: getComputedStyle(element).getPropertyValue("--v2-background-bg-layer-04").trim(),
99+
})),
100+
)
101+
.toEqual({ segment: "rgb(219, 219, 219)", expected: "#dbdbdbff" })
102+
103+
await question.getByRole("button", { name: "Questions 3" }).click()
104+
await expect(question.getByText("3 of 4 questions")).toBeVisible()
105+
await expect(question.getByText("Question 3?", { exact: true })).toBeVisible()
106+
})
107+
73108
test("shows a pending permission dock", async ({ page }) => {
74109
await mockServer(page, {
75110
permissions: [

packages/session-ui/src/components/message-part.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@
891891
width: 16px;
892892
height: 2px;
893893
border-radius: 999px;
894-
background-color: var(--icon-weak-base);
894+
background-color: var(--v2-background-bg-layer-04);
895895
transition: background-color 0.2s ease;
896896
}
897897

0 commit comments

Comments
 (0)