File tree Expand file tree Collapse file tree 2 files changed +10
-14
lines changed
Expand file tree Collapse file tree 2 files changed +10
-14
lines changed Original file line number Diff line number Diff line change @@ -65,11 +65,9 @@ test.describe('Prompts', () => {
6565 await page . getByTestId ( 'system-message-input' ) . fill ( 'mocktest kurssitesti onnistui' )
6666 await page . getByRole ( 'button' , { name : 'Save' } ) . click ( )
6767
68- // Close the prompt modal to go back to the prompts list
69- await page . getByTestId ( 'close-modal' ) . click ( )
70-
71- // Navigate directly to chat with the prompt using URL parameter
72- await page . goto ( `/test-course-course-id?promptId=${ newPromptName } ` )
68+ // Dialog closes automatically, now back at prompts list
69+ // Select the prompt by clicking on its row
70+ await page . getByTestId ( `prompt-row-${ newPromptName } ` ) . click ( )
7371
7472 // Now in chat view
7573 // The prompt is active.
@@ -118,11 +116,9 @@ test.describe('Prompts', () => {
118116 await page . getByTestId ( `source-material-rag-${ test . info ( ) . workerIndex } -teacher` ) . click ( )
119117 await page . getByRole ( 'button' , { name : 'Save' } ) . click ( )
120118
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 } ` )
119+ // Dialog closes automatically, now back at prompts list
120+ // Select the prompt by clicking on its row
121+ await page . getByTestId ( `prompt-row-${ newPromptName } ` ) . click ( )
126122
127123 // Now in chat view
128124 // The prompt is active.
Original file line number Diff line number Diff line change @@ -45,10 +45,10 @@ test.describe('Student', () => {
4545 await page . goto ( '/test-course-course-id' )
4646 await acceptDisclaimer ( page )
4747
48- // Students shouldn't see the edit prompt button in the sidebar
49- await expect ( page . getByTestId ( 'edit-prompt-button' ) ) . toBeHidden ( )
48+ // Students shouldn't see the edit prompt button in the sidebar (when no prompt is selected)
49+ await expect ( page . getByTestId ( 'edit-prompt-button' ) ) . not . toBeVisible ( )
5050
51- // But they should see the prompt details button when a prompt is selected
52- await expect ( page . getByTestId ( 'prompt-details -button' ) ) . toBeVisible ( )
51+ // They should see the button to choose a prompt
52+ await expect ( page . getByTestId ( 'choose-prompt -button' ) ) . toBeVisible ( )
5353 } )
5454} )
You can’t perform that action at this time.
0 commit comments