Skip to content

Commit

Permalink
fix: more test
Browse files Browse the repository at this point in the history
  • Loading branch information
swuecho committed Mar 28, 2023
1 parent aa37ee8 commit d15c670
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions e2e/tests/10_session_answer_regenerate.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ test('test', async ({ page }) => {
await page.locator('#image-wrapper .chat-message:nth-child(6) .chat-message-regenerate').click();
await page.waitForTimeout(1000);

const third_answer_regen = await page.$eval('#image-wrapper .chat-message:nth-child(6) .message-text', (el: HTMLElement) => el.innerText);
const third_answer_regen = await page.$eval('#image-wrapper .chat-message:nth-child(6) .message-text', (el: HTMLElement) => el.innerText);
// check the third_answer has the debug message
expect(third_answer_regen).toContain('test_debug_2');

Expand All @@ -77,9 +77,14 @@ test('test', async ({ page }) => {
await page.waitForTimeout(1000);

// check the second answer has been regenerated
const sec_answer_regen_2 = await page.$eval('#image-wrapper .chat-message:nth-child(4) .message-text', (el: HTMLElement) => el.innerText);
const sec_answer_regen_2 = await page.$eval('#image-wrapper .chat-message:nth-child(4) .message-text', (el: HTMLElement) => el.innerText);
// check the sec_answer has the debug message
expect(sec_answer_regen_2).toContain('test_debug_1');
expect(sec_answer_regen_2).not.toContain('test_debug_2')

// check the second answer has been regenerated
const sec_answer_regen_3 = await page.$eval('#image-wrapper .chat-message:nth-child(4) .message-text', (el: HTMLElement) => el.innerText);
// check the sec_answer has the debug message
expect(sec_answer_regen_3).toContain('test_debug_1');
expect(sec_answer_regen_2).not.toContain('test_debug_2')
});

0 comments on commit d15c670

Please sign in to comment.