-
Notifications
You must be signed in to change notification settings - Fork 1
/
82-invalid-urls-should-be-rejected-in-the-ui.cy.ts
50 lines (44 loc) · 1.51 KB
/
82-invalid-urls-should-be-rejected-in-the-ui.cy.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/**
* @licstart The following is the entire license notice for the
* JavaScript code in this page
*
* Copyright (c) 2024 Marcel Suter - Replayer
*
* This source code is licensed under the AGPL license found in the
* LICENSE file in the root of this projects source tree.
*
* @licend The above is the entire license notice for the
* JavaScript code in this page
*/
describe('testing the issue "Invalid URLs should be rejected in the UI #82" for regression', () => {
it('should reject an invalid protocol', () => {
// ACT
cy.loadMediaUrl('httpx://example.com');
// ASSERT
cy.get('input[data-cy="input-url"]')
.invoke('prop', 'validationMessage')
.should((text: string) => {
expect(text).contains('Please match the requested format.');
});
});
it('should reject a completely invalid URL', () => {
// ACT
cy.loadMediaUrl('x//example.com');
// ASSERT
cy.get('input[data-cy="input-url"]')
.invoke('prop', 'validationMessage')
.should((text: string) => {
expect(text).contains('Please enter a URL.');
});
});
it('should reject a single word', () => {
// ACT
cy.loadMediaUrl('example');
// ASSERT
cy.get('input[data-cy="input-url"]')
.invoke('prop', 'validationMessage')
.should((text: string) => {
expect(text).contains('Please enter a URL.');
});
});
});