test(e2e, playwright): tool-panel.tsx, added tests for buttons in 'Get Help' (#52434)

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
This commit is contained in:
weilirs
2023-12-06 11:05:34 -06:00
committed by GitHub
co-authored by Shaun Hamilton
parent 2c62b06427
commit a0ff12412c
+17
View File
@@ -49,5 +49,22 @@ test.describe('Tool Panel', () => {
helpLinks.push(await page.getByTestId('ask-for-help').textContent());
expect(helpLinks).toEqual(expectedHelpLinks);
const hintLink = page.getByRole('menuitem', { name: 'Get a Hint' });
await expect(hintLink).toHaveAttribute(
'href',
'https://forum.freecodecamp.org/t/18201'
);
await expect(hintLink).toHaveAttribute('target', '_blank');
await page.getByRole('menuitem', { name: 'Ask for Help' }).click();
await expect(
page.getByRole('heading', {
name: translations.buttons['ask-for-help'],
exact: true
})
).toBeVisible();
// "Watch a Video" is done by "video-modal.spec.ts"
});
});