mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
feat: validate portfolio image correctly (#57084)
This commit is contained in:
+11
-2
@@ -63,12 +63,21 @@ test.describe('Add Portfolio Item', () => {
|
||||
test('The image has validation', async ({ page }) => {
|
||||
await page.getByLabel(translations.settings.labels.image).fill('T');
|
||||
await expect(page.getByTestId('image-validation')).toContainText(
|
||||
'URL must link directly to an image file'
|
||||
'Please use a valid URL'
|
||||
);
|
||||
await page
|
||||
.getByLabel(translations.settings.labels.image)
|
||||
.fill('http://helloworld.com/image.png');
|
||||
.fill(
|
||||
'https://cdn.freecodecamp.org/universal/favicons/favicon-32x32.png'
|
||||
);
|
||||
await expect(page.getByTestId('image-validation')).toBeHidden();
|
||||
|
||||
await page
|
||||
.getByLabel(translations.settings.labels.image)
|
||||
.fill('https://cdn.freecodecamp.org/universal/favicons/favicon-32x32.pn');
|
||||
await expect(page.getByTestId('image-validation')).toContainText(
|
||||
'URL must link directly to an image file'
|
||||
);
|
||||
});
|
||||
|
||||
test('The description has validation', async ({ page }) => {
|
||||
|
||||
Reference in New Issue
Block a user