Skip to content

Commit 3ab545c

Browse files
committed
fix: tests for prompt selection
1 parent 463b85f commit 3ab545c

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

e2e/prompts.spec.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,11 @@ test.describe('Prompts', () => {
6565
await page.getByTestId('system-message-input').fill('mocktest kurssitesti onnistui')
6666
await page.getByRole('button', { name: 'Save' }).click()
6767

68-
// await page.getByTestId('close-modal').click()
68+
// Close the prompt modal to go back to the prompts list
69+
await page.getByTestId('close-modal').click()
6970

70-
// Prompt is created and link is visible
71-
await page.getByText(`Link to chat with the prompt '${newPromptName}' active`).click()
71+
// Navigate directly to chat with the prompt using URL parameter
72+
await page.goto(`/test-course-course-id?promptId=${newPromptName}`)
7273

7374
// Now in chat view
7475
// The prompt is active.
@@ -117,8 +118,11 @@ test.describe('Prompts', () => {
117118
await page.getByTestId(`source-material-rag-${test.info().workerIndex}-teacher`).click()
118119
await page.getByRole('button', { name: 'Save' }).click()
119120

120-
// Prompt is created and link is visible
121-
await page.getByText(`Link to chat with the prompt '${newPromptName}' active`).click()
121+
// Close the prompt modal
122+
await page.getByTestId('close-modal').click()
123+
124+
// Navigate directly to chat with the prompt using URL parameter
125+
await page.goto(`/test-course-course-id?promptId=${newPromptName}`)
122126

123127
// Now in chat view
124128
// The prompt is active.

e2e/student.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ test.describe('Student', () => {
4646
await acceptDisclaimer(page)
4747

4848
await page.getByTestId('choose-prompt-button').click()
49-
await page.getByTestId('pick-prompt-button').first().click()
49+
await page.getByTestId('prompt-row-Test Prompt').click()
5050

5151
await expect(page.getByTestId('edit-prompt-button')).toBeHidden()
5252
await expect(page.getByTestId('prompt-details-button')).toBeVisible()

0 commit comments

Comments
 (0)