mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-09-24 23:01:18 +08:00
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:
co-authored by
Shaun Hamilton
parent
2c62b06427
commit
a0ff12412c
@@ -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"
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user