@newskit-render/core 2.11.0 → 2.12.0
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.
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [2.12.0](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@2.12.0-alpha.0...@newskit-render/core@2.12.0) (2022-10-28)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @newskit-render/core
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [2.11.0](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@2.11.0-alpha.0...@newskit-render/core@2.11.0) (2022-10-27)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @newskit-render/core
|
|
@@ -1,12 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
describe('Book a holiday stop', () => {
|
|
2
|
+
beforeEach(() => {
|
|
3
|
+
cy.GetAcsSession()
|
|
4
|
+
cy.mockConsentAndVisit('/account/holiday-stop/book')
|
|
5
|
+
})
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
it('should display book a holiday stop page', () => {
|
|
8
|
+
cy.get('a[href="/account/subscription-and-billing"]').should('be.visible')
|
|
9
|
+
cy.contains('[data-testid="introduction-title"]', 'Book a holiday stop')
|
|
10
|
+
cy.contains('Add a Holiday Stop')
|
|
11
|
+
cy.get('a[href="/account/holiday-stop/upcoming-holiday-stops"]').should(
|
|
12
|
+
'not.exist'
|
|
13
|
+
)
|
|
14
|
+
cy.get('a[href="/account/holiday-stop/previous-holiday-stops"]').should(
|
|
15
|
+
'not.exist'
|
|
16
|
+
)
|
|
17
|
+
})
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
describe.skip(
|
|
21
|
+
'Upcoming holiday stops',
|
|
22
|
+
{
|
|
23
|
+
env: {
|
|
24
|
+
MAIN_COOKIE_NAME: 'acs_tnl',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
() => {
|
|
28
|
+
beforeEach(() => {
|
|
29
|
+
cy.GetTnlAcsSession()
|
|
30
|
+
cy.mockConsentAndVisit('/account/holiday-stop/book')
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
it('should navigate to the Upcoming holiday stops and display the list of upcoming holiday stops', () => {
|
|
34
|
+
cy.get('a[href="/account/holiday-stop/upcoming-holiday-stops"]').click()
|
|
35
|
+
cy.get('[data-testid="content-list"] > ul > li').should('have.length', 6)
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
)
|
|
@@ -48,6 +48,10 @@ const userMap = {
|
|
|
48
48
|
username: 'render-paypal-payment@yopmail.com',
|
|
49
49
|
password: 'testing123',
|
|
50
50
|
},
|
|
51
|
+
tnl: {
|
|
52
|
+
username: 'cmp1aug2022printstag@yopmail.com',
|
|
53
|
+
password: 'Password123',
|
|
54
|
+
},
|
|
51
55
|
}
|
|
52
56
|
|
|
53
57
|
Cypress.Commands.add('GetAcsSession', (user = 'default') => {
|
|
@@ -73,6 +77,29 @@ Cypress.Commands.add('GetAcsSession', (user = 'default') => {
|
|
|
73
77
|
})
|
|
74
78
|
})
|
|
75
79
|
|
|
80
|
+
Cypress.Commands.add('GetTnlAcsSession', (user = 'tnl') => {
|
|
81
|
+
const { username, password } = userMap[user]
|
|
82
|
+
cy.request({
|
|
83
|
+
method: 'POST',
|
|
84
|
+
url: 'https://login.staging-thetimes.co.uk/services/session',
|
|
85
|
+
headers: {
|
|
86
|
+
'Content-Type': 'application/vnd.newsuk.acs.createsession-v1+json',
|
|
87
|
+
},
|
|
88
|
+
body: {
|
|
89
|
+
rememberMe: false,
|
|
90
|
+
gotoUrl: 'https://login.staging-thesun.co.uk/',
|
|
91
|
+
sso: false,
|
|
92
|
+
authCredentials: {
|
|
93
|
+
username,
|
|
94
|
+
password,
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
}).then((response) => {
|
|
98
|
+
const acs_tnl = response.body.acsCookies.cookies[0].value
|
|
99
|
+
cy.setCookie('acs_tnl', acs_tnl)
|
|
100
|
+
})
|
|
101
|
+
})
|
|
102
|
+
|
|
76
103
|
Cypress.Commands.add('createNewEmail', () => {
|
|
77
104
|
const newEmail =
|
|
78
105
|
Cypress.env('MAIN_USER_EMAIL').split('@')[0].split('').reverse().join('') +
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@newskit-render/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.12.0",
|
|
4
4
|
"description": "Newskit Render - Core package",
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
"@emotion/styled": "11.10.4",
|
|
41
41
|
"@newskit-render/api": "^1.2.1",
|
|
42
42
|
"@newskit-render/auth": "^1.1.1",
|
|
43
|
-
"@newskit-render/checkout": "^1.3.
|
|
43
|
+
"@newskit-render/checkout": "^1.3.7",
|
|
44
44
|
"@newskit-render/feature-flags": "^1.2.0",
|
|
45
45
|
"@newskit-render/feed": "^1.1.1",
|
|
46
|
-
"@newskit-render/my-account": "^3.
|
|
47
|
-
"@newskit-render/shared-components": "^1.
|
|
48
|
-
"@newskit-render/standalone-components": "^1.7.
|
|
46
|
+
"@newskit-render/my-account": "^3.9.0",
|
|
47
|
+
"@newskit-render/shared-components": "^1.9.0",
|
|
48
|
+
"@newskit-render/standalone-components": "^1.7.1",
|
|
49
49
|
"@newskit-render/validation": "^1.2.1",
|
|
50
50
|
"cross-fetch": "3.1.5",
|
|
51
51
|
"graphql": "15.6.0",
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { getProviderProps, HolidayStopList } from '@newskit-render/my-account'
|
|
2
|
+
import newrelic from 'newrelic'
|
|
3
|
+
import React, { useContext } from 'react'
|
|
4
|
+
import { AppContext } from '../../../context/app-context'
|
|
5
|
+
import { createThemeDropdownObject } from '../../../helpers/createThemeDropdownObject'
|
|
6
|
+
|
|
7
|
+
const AccountPreviousHolidayStops = (props) => {
|
|
8
|
+
const { theme, setTheme } = useContext(AppContext)
|
|
9
|
+
const themeDropdownObject = createThemeDropdownObject(setTheme)
|
|
10
|
+
return (
|
|
11
|
+
<HolidayStopList
|
|
12
|
+
{...props}
|
|
13
|
+
customTheme={theme}
|
|
14
|
+
themeDropdownObject={themeDropdownObject}
|
|
15
|
+
holidayStopType="previous"
|
|
16
|
+
/>
|
|
17
|
+
)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default AccountPreviousHolidayStops
|
|
21
|
+
|
|
22
|
+
export const getServerSideProps = async (context) => {
|
|
23
|
+
newrelic.setTransactionName('Account: Previous Holiday Stops')
|
|
24
|
+
return getProviderProps({ ...context, provider: 'HolidayStop' })
|
|
25
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { getProviderProps, HolidayStopList } from '@newskit-render/my-account'
|
|
2
|
+
import newrelic from 'newrelic'
|
|
3
|
+
import React, { useContext } from 'react'
|
|
4
|
+
import { AppContext } from '../../../context/app-context'
|
|
5
|
+
import { createThemeDropdownObject } from '../../../helpers/createThemeDropdownObject'
|
|
6
|
+
|
|
7
|
+
const AccountUpcomingHolidayStops = (props) => {
|
|
8
|
+
const { theme, setTheme } = useContext(AppContext)
|
|
9
|
+
const themeDropdownObject = createThemeDropdownObject(setTheme)
|
|
10
|
+
return (
|
|
11
|
+
<HolidayStopList
|
|
12
|
+
{...props}
|
|
13
|
+
customTheme={theme}
|
|
14
|
+
themeDropdownObject={themeDropdownObject}
|
|
15
|
+
holidayStopType="upcoming"
|
|
16
|
+
/>
|
|
17
|
+
)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default AccountUpcomingHolidayStops
|
|
21
|
+
|
|
22
|
+
export const getServerSideProps = async (context) => {
|
|
23
|
+
newrelic.setTransactionName('Account: Upcoming Holiday Stops')
|
|
24
|
+
return getProviderProps({ ...context, provider: 'HolidayStop' })
|
|
25
|
+
}
|