test: fix test

This commit is contained in:
alvaromartmart 2024-06-26 08:12:28 +02:00
parent 0eb57e7774
commit 23335df9a4

View file

@ -40,8 +40,10 @@ test('should contain text attachment', async ({ runUITest }) => {
]) {
await page.getByText(`attach "${name}"`, { exact: true }).click();
const downloadPromise = page.waitForEvent('download');
if (displayedAsText)
if (displayedAsText){
await page.locator('.expandable-title', { hasText: name }).locator('.codicon-chevron-right').click();
await expect(page.getByLabel(name)).toContainText(content.split('\n')?.[0]);
}
await page.getByRole('link', { name: name }).click();
const download = await downloadPromise;
expect(download.suggestedFilename()).toBe(name);