@newskit-render/core 4.21.3-alpha.0 → 4.21.3-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -17,11 +17,6 @@ describe('Upcoming Holiday Stops', () => {
|
|
|
17
17
|
cy.GetTnlAcsSession('tnl')
|
|
18
18
|
cy.mockConsentAndVisit('/account/holiday-stop')
|
|
19
19
|
})
|
|
20
|
-
afterEach(() => {
|
|
21
|
-
cy.clock().then((clock) => {
|
|
22
|
-
clock.restore()
|
|
23
|
-
})
|
|
24
|
-
})
|
|
25
20
|
|
|
26
21
|
it('should display Upcoming Holiday Stops when there are more than 5 holiday stops', () => {
|
|
27
22
|
cy.get('a[href="/account/holiday-stop/upcoming-holiday-stops"]').should(
|
|
@@ -41,24 +36,23 @@ describe('Upcoming Holiday Stops', () => {
|
|
|
41
36
|
})
|
|
42
37
|
})
|
|
43
38
|
|
|
44
|
-
describe
|
|
39
|
+
describe('Cancel Holiday Stop', () => {
|
|
45
40
|
beforeEach(() => {
|
|
46
41
|
cy.clock(Date.UTC(2022, 10, 30), ['Date'])
|
|
47
42
|
cy.GetTnlAcsSession('tnl')
|
|
48
43
|
cy.mockConsentAndVisit('/account/holiday-stop')
|
|
49
44
|
})
|
|
50
|
-
|
|
51
|
-
cy.clock().then((clock) => {
|
|
52
|
-
clock.restore()
|
|
53
|
-
})
|
|
54
|
-
})
|
|
45
|
+
|
|
55
46
|
it('should show popup and cancel Holiday Stop', () => {
|
|
56
47
|
cy.intercept('POST', '/api/account/mutate', {
|
|
57
48
|
statusCode: 200,
|
|
58
49
|
body: { data: { deleteUserHolidayStop: { success: true } } },
|
|
59
50
|
})
|
|
60
51
|
cy.get('[data-testid="content-list"] > ul > li')
|
|
61
|
-
|
|
52
|
+
.contains('21/01/23')
|
|
53
|
+
.parents('li')
|
|
54
|
+
.contains('Cancel')
|
|
55
|
+
.click()
|
|
62
56
|
cy.get('[data-testid="primary-button"]').click()
|
|
63
57
|
cy.contains(
|
|
64
58
|
'[data-testid="toast-container"]',
|
|
@@ -67,17 +61,13 @@ describe.skip('Cancel Holiday Stop', () => {
|
|
|
67
61
|
})
|
|
68
62
|
})
|
|
69
63
|
|
|
70
|
-
describe
|
|
64
|
+
describe('Edit button Holiday Stop', () => {
|
|
71
65
|
beforeEach(() => {
|
|
72
66
|
cy.clock(Date.UTC(2022, 10, 30), ['Date'])
|
|
73
67
|
cy.GetTnlAcsSession('tnl')
|
|
74
68
|
cy.mockConsentAndVisit('/account/holiday-stop')
|
|
75
69
|
})
|
|
76
|
-
|
|
77
|
-
cy.clock().then((clock) => {
|
|
78
|
-
clock.restore()
|
|
79
|
-
})
|
|
80
|
-
})
|
|
70
|
+
|
|
81
71
|
it('should show redirect to edit page and show corrensponding data', () => {
|
|
82
72
|
cy.intercept('POST', '/api/account/mutate', {
|
|
83
73
|
statusCode: 200,
|
|
@@ -85,11 +75,14 @@ describe.skip('Edit button Holiday Stop', () => {
|
|
|
85
75
|
})
|
|
86
76
|
|
|
87
77
|
cy.get('[data-testid="content-list"] > ul > li')
|
|
88
|
-
|
|
78
|
+
.contains('21/01/23')
|
|
79
|
+
.parents('li')
|
|
80
|
+
.contains('Edit')
|
|
81
|
+
.click()
|
|
89
82
|
cy.url().should('match', /\/account\/edit\/holiday-stop?/)
|
|
90
83
|
|
|
91
|
-
cy.get('[name="startDate"]').invoke('val').should('equal', '
|
|
92
|
-
cy.get('[name="endDate"]').invoke('val').should('equal', '
|
|
84
|
+
cy.get('[name="startDate"]').invoke('val').should('equal', '21/01/2023')
|
|
85
|
+
cy.get('[name="endDate"]').invoke('val').should('equal', '31/01/2023')
|
|
93
86
|
|
|
94
87
|
const dateFormatOptions = {
|
|
95
88
|
year: 'numeric',
|
|
@@ -101,12 +94,12 @@ describe.skip('Edit button Holiday Stop', () => {
|
|
|
101
94
|
cy.get('input[name="startDate"]')
|
|
102
95
|
.clear()
|
|
103
96
|
.type(
|
|
104
|
-
new Date('
|
|
97
|
+
new Date('21/01/2023').toLocaleDateString('en-GB', dateFormatOptions)
|
|
105
98
|
)
|
|
106
99
|
cy.get('input[name="endDate"]')
|
|
107
100
|
.clear()
|
|
108
101
|
.type(
|
|
109
|
-
new Date('
|
|
102
|
+
new Date('31/01/2023').toLocaleDateString('en-GB', dateFormatOptions)
|
|
110
103
|
)
|
|
111
104
|
|
|
112
105
|
cy.get('body').click({ force: true })
|