Skip to content

Commit 6898425

Browse files
committed
Merge branch 'chore-phpunit-tests-previews-iteration-2' of github.com:wpengine/hwptoolkit into chore-phpunit-tests-previews-iteration-2
2 parents 2916d1f + 06dc013 commit 6898425

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

plugins/hwp-previews/tests/e2e/specs/settings.spec.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,17 @@ test.describe("HWP Previews Admin Settings", () => {
132132
expect(inputValue).toContain(buttonText.trim());
133133
}
134134
});
135+
136+
test(`URL input rejects an incorrect URL value`, async ({ page }) => {
137+
const urlInput = page.locator("input.hwp-previews-url");
138+
const incorrectUrlValue = "this is not a valid url";
139+
140+
await urlInput.fill(incorrectUrlValue);
141+
await page.getByRole("button", { name: "Save Changes" }).click();
142+
143+
const validationMessage = await urlInput.evaluate(
144+
(element) => element.validationMessage,
145+
);
146+
expect(validationMessage).not.toBe("");
147+
});
135148
});

0 commit comments

Comments
 (0)