@newskit-render/core 1.44.2 → 1.45.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,52 @@
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
+ # [1.45.0](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@1.44.6...@newskit-render/core@1.45.0) (2022-04-01)
7
+
8
+
9
+ ### Features
10
+
11
+ * **PPDSR-694:** Ensure sitemap works on demo site ([#664](https://github.com/newscorp-ghfb/ncu-newskit-render/issues/664)) ([ba3d10f](https://github.com/newscorp-ghfb/ncu-newskit-render/commit/ba3d10f296f50ba40a9684041f10ce2f9c0b3424))
12
+
13
+
14
+
15
+
16
+
17
+ ## [1.44.6](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@1.44.5...@newskit-render/core@1.44.6) (2022-04-01)
18
+
19
+ **Note:** Version bump only for package @newskit-render/core
20
+
21
+
22
+
23
+
24
+
25
+ ## [1.44.5](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@1.44.4...@newskit-render/core@1.44.5) (2022-04-01)
26
+
27
+ **Note:** Version bump only for package @newskit-render/core
28
+
29
+
30
+
31
+
32
+
33
+ ## [1.44.4](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@1.44.3...@newskit-render/core@1.44.4) (2022-03-31)
34
+
35
+
36
+ ### Bug Fixes
37
+
38
+ * **PPDSR-747:** Add dob data to profile ([#660](https://github.com/newscorp-ghfb/ncu-newskit-render/issues/660)) ([8ebd19b](https://github.com/newscorp-ghfb/ncu-newskit-render/commit/8ebd19b7d5003074e4d25c457c0c0747c7796cc7))
39
+
40
+
41
+
42
+
43
+
44
+ ## [1.44.3](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@1.44.2...@newskit-render/core@1.44.3) (2022-03-31)
45
+
46
+ **Note:** Version bump only for package @newskit-render/core
47
+
48
+
49
+
50
+
51
+
6
52
  ## [1.44.2](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@1.44.1...@newskit-render/core@1.44.2) (2022-03-30)
7
53
 
8
54
  **Note:** Version bump only for package @newskit-render/core
@@ -1,10 +1,7 @@
1
- import { within } from '@testing-library/react'
2
- import Article, {
1
+ import {
3
2
  ArticleSlug,
4
3
  getServerSideProps,
5
4
  } from '../../pages/[section]/[articleId]/[articleSlug]'
6
- import { renderWithQuery } from '../../helpers/test-utils'
7
- import { getUniversalArticleMock } from '../../helpers/mocks'
8
5
  import { URL, Slug } from '../../helpers/global-types'
9
6
 
10
7
  const props: ArticleSlug = {
@@ -57,6 +54,31 @@ const props: ArticleSlug = {
57
54
  twitterUsername: 'D_Trump',
58
55
  siteHost: 'hostname',
59
56
  gscId: '4320982',
57
+ recommendations: [
58
+ {
59
+ href:
60
+ 'https://www.thesun.co.uk/wp-content/uploads/2022/03/image-656eaa885d.jpg?strip=all&w=600&h=338&crop=1',
61
+ tag: 'FOOT ON THE GAZ',
62
+ text:
63
+ 'Bale considering short deal with new club before RETIRING after World Cup',
64
+ title: 'FOOT ON THE GAZ',
65
+ },
66
+ {
67
+ href:
68
+ 'https://www.thesun.co.uk/wp-content/uploads/2022/03/image-a21f115694-1.jpg?strip=all&w=600&h=338&crop=1',
69
+ tag: 'TOUGH TIMES',
70
+ text:
71
+ 'I only made £5k last year - I sold £801k villa for cash, says Claire Sweeney',
72
+ title: 'TOUGH TIMES',
73
+ },
74
+ {
75
+ href: null,
76
+ tag: 'TOUGH TIMES',
77
+ text:
78
+ 'I only made £5k last year - I sold £801k villa for cash, says Claire Sweeney',
79
+ title: 'TOUGH TIMES',
80
+ },
81
+ ],
60
82
  }
61
83
 
62
84
  const user = {
@@ -87,6 +109,9 @@ jest.mock('@newskit-render/api', () => ({
87
109
  })
88
110
  }),
89
111
  getAcsCookie: jest.fn().mockReturnValue({ Cookie: 'something' }),
112
+ Publisher: {
113
+ SUN_UK: 'SUN_UK',
114
+ },
90
115
  }))
91
116
 
92
117
  jest.mock('@newskit-render/my-account', () => {
@@ -94,21 +119,37 @@ jest.mock('@newskit-render/my-account', () => {
94
119
  PastDueBannerExternal: 'PastDueBannerExternal',
95
120
  }
96
121
  })
122
+ jest.mock('@newskit-render/standalone-components', () => {
123
+ return {
124
+ recommendationsProvider: jest.fn().mockResolvedValueOnce([
125
+ {
126
+ href:
127
+ 'https://www.thesun.co.uk/wp-content/uploads/2022/03/image-656eaa885d.jpg?strip=all&w=600&h=338&crop=1',
128
+ tag: 'FOOT ON THE GAZ',
129
+ text:
130
+ 'Bale considering short deal with new club before RETIRING after World Cup',
131
+ title: 'FOOT ON THE GAZ',
132
+ },
133
+ {
134
+ href:
135
+ 'https://www.thesun.co.uk/wp-content/uploads/2022/03/image-a21f115694-1.jpg?strip=all&w=600&h=338&crop=1',
136
+ tag: 'TOUGH TIMES',
137
+ text:
138
+ 'I only made £5k last year - I sold £801k villa for cash, says Claire Sweeney',
139
+ title: 'TOUGH TIMES',
140
+ },
141
+ {
142
+ href: null,
143
+ tag: 'TOUGH TIMES',
144
+ text:
145
+ 'I only made £5k last year - I sold £801k villa for cash, says Claire Sweeney',
146
+ title: 'TOUGH TIMES',
147
+ },
148
+ ]),
149
+ }
150
+ })
97
151
 
98
152
  describe('Article', () => {
99
- test('should load ArticleDisplay component and pass it query data', async () => {
100
- const { getByTestId } = renderWithQuery(
101
- Article,
102
- getUniversalArticleMock,
103
- props
104
- )
105
-
106
- const headLine = within(getByTestId('HeadLine')).getByText(
107
- 'Mock Article: Lorem ipsum dolor sit amet consectetur adipiscing elit'
108
- )
109
- expect(headLine).toBeInTheDocument()
110
- })
111
-
112
153
  describe('getServerSideProps', () => {
113
154
  beforeAll(() => {
114
155
  process.env = Object.assign(process.env, {
@@ -118,7 +159,7 @@ describe('Article', () => {
118
159
  })
119
160
  })
120
161
 
121
- test('should return props', async () => {
162
+ it('should return props', async () => {
122
163
  const setHeaderMock = jest.fn()
123
164
 
124
165
  const response = await getServerSideProps({
@@ -12,6 +12,7 @@ import {
12
12
  Visible,
13
13
  TitleBar,
14
14
  } from 'newskit'
15
+ import { ArticleRecommendation } from '@newskit-render/standalone-components'
15
16
  import ViewMoreButton from '../common/ViewMoreButton'
16
17
 
17
18
  const Highlights: React.FC<{
@@ -60,40 +61,10 @@ const Highlights: React.FC<{
60
61
 
61
62
  <Block spaceStack="space040">
62
63
  <Grid xsMargin="space000">
63
- {highlightsArticles.map(({ title, href }) => (
64
- <Cell key={title} xs={12} sm={6} lg={12}>
64
+ {highlightsArticles.map((article) => (
65
+ <Cell key={article.title} xs={12} sm={6} lg={12}>
65
66
  <Block spaceStack="space040" data-testid="HighlightsHorizontalCard">
66
- <Card
67
- href="https://newskit.co.uk/"
68
- layout="horizontal"
69
- media={{
70
- src: href,
71
- alt: 'Card Media',
72
- loadingAspectRatio: '3:2',
73
- overrides: {
74
- width: '150px',
75
- height: '100px',
76
- },
77
- }}
78
- overrides={{
79
- stylePreset: 'cardContainer',
80
- mediaContainer: {
81
- spaceInline: 'space030',
82
- },
83
- }}
84
- >
85
- <Headline
86
- headingAs="h4"
87
- overrides={{
88
- typographyPreset: {
89
- xs: 'editorialHeadline040',
90
- xl: 'editorialHeadline020',
91
- },
92
- }}
93
- >
94
- {title}
95
- </Headline>
96
- </Card>
67
+ <ArticleRecommendation article={article} size="small" />
97
68
  </Block>
98
69
  </Cell>
99
70
  ))}
@@ -13,6 +13,7 @@ import {
13
13
  Headline,
14
14
  Visible,
15
15
  } from 'newskit'
16
+ import { ArticleRecommendation } from '@newskit-render/standalone-components'
16
17
  import ViewMoreButton from '../common/ViewMoreButton'
17
18
 
18
19
  const viewMoreButton = () => <ViewMoreButton href="/" />
@@ -48,65 +49,15 @@ const RelatedArticles: React.FC<{
48
49
  </Block>
49
50
 
50
51
  <Grid xsMargin="space000">
51
- {relatedArticles.map(({ title, href, text, tag }) => (
52
+ {relatedArticles.map((article) => (
52
53
  <Cell
53
- key={title}
54
+ key={article.title}
54
55
  xs={12}
55
56
  sm={6}
56
57
  lg={3}
57
58
  data-testid="RelatedArticlesVerticalCard"
58
59
  >
59
- <Card
60
- media={{
61
- src: href,
62
- alt: title,
63
- loadingAspectRatio: '3:2',
64
- }}
65
- overrides={{
66
- stylePreset: 'cardContainer',
67
- mediaContainer: {
68
- spaceInline: 'space030',
69
- },
70
- }}
71
- >
72
- <Block spaceStack="space060">
73
- <Block
74
- spaceStack={{
75
- xs: 'space040',
76
- md: 'space050',
77
- }}
78
- >
79
- <Headline
80
- headingAs="h6"
81
- overrides={{
82
- typographyPreset: {
83
- xs: 'editorialHeadline020',
84
- md: 'editorialHeadline030',
85
- xl: 'editorialHeadline040',
86
- },
87
- }}
88
- >
89
- {title}
90
- </Headline>
91
- </Block>
92
- <Block
93
- spaceStack={{
94
- xs: 'space040',
95
- md: 'space050',
96
- }}
97
- >
98
- <TextBlock
99
- stylePreset="inkContrast"
100
- typographyPreset={{
101
- xs: 'editorialParagraph010',
102
- md: 'editorialParagraph020',
103
- }}
104
- >
105
- {text}
106
- </TextBlock>
107
- </Block>
108
- </Block>
109
- </Card>
60
+ <ArticleRecommendation article={article} size="large" />
110
61
  </Cell>
111
62
  ))}
112
63
  <Cell xs={12}>
@@ -2747,7 +2747,7 @@ exports[`Article should render tile and sub title 1`] = `
2747
2747
  }
2748
2748
 
2749
2749
  @media screen and (max-width: 767px) {
2750
- .emotion-221 {
2750
+ .emotion-222 {
2751
2751
  font-family: "Bitter",serif;
2752
2752
  font-size: 20px;
2753
2753
  line-height: 22.5px;
@@ -2756,13 +2756,13 @@ exports[`Article should render tile and sub title 1`] = `
2756
2756
  padding: 0.5px 0px;
2757
2757
  }
2758
2758
 
2759
- .emotion-221::before {
2759
+ .emotion-222::before {
2760
2760
  content: '';
2761
2761
  margin-bottom: -0.2055em;
2762
2762
  display: block;
2763
2763
  }
2764
2764
 
2765
- .emotion-221::after {
2765
+ .emotion-222::after {
2766
2766
  content: '';
2767
2767
  margin-top: -0.2275em;
2768
2768
  display: block;
@@ -2770,7 +2770,7 @@ exports[`Article should render tile and sub title 1`] = `
2770
2770
  }
2771
2771
 
2772
2772
  @media screen and (min-width: 768px) and (max-width: 1439px) {
2773
- .emotion-221 {
2773
+ .emotion-222 {
2774
2774
  font-family: "Bitter",serif;
2775
2775
  font-size: 22px;
2776
2776
  line-height: 24.75px;
@@ -2779,13 +2779,13 @@ exports[`Article should render tile and sub title 1`] = `
2779
2779
  padding: 0.5px 0px;
2780
2780
  }
2781
2781
 
2782
- .emotion-221::before {
2782
+ .emotion-222::before {
2783
2783
  content: '';
2784
2784
  margin-bottom: -0.2055em;
2785
2785
  display: block;
2786
2786
  }
2787
2787
 
2788
- .emotion-221::after {
2788
+ .emotion-222::after {
2789
2789
  content: '';
2790
2790
  margin-top: -0.2275em;
2791
2791
  display: block;
@@ -2793,7 +2793,7 @@ exports[`Article should render tile and sub title 1`] = `
2793
2793
  }
2794
2794
 
2795
2795
  @media screen and (min-width: 1440px) {
2796
- .emotion-221 {
2796
+ .emotion-222 {
2797
2797
  font-family: "Bitter",serif;
2798
2798
  font-size: 24px;
2799
2799
  line-height: 27px;
@@ -2802,30 +2802,30 @@ exports[`Article should render tile and sub title 1`] = `
2802
2802
  padding: 0.5px 0px;
2803
2803
  }
2804
2804
 
2805
- .emotion-221::before {
2805
+ .emotion-222::before {
2806
2806
  content: '';
2807
2807
  margin-bottom: -0.2055em;
2808
2808
  display: block;
2809
2809
  }
2810
2810
 
2811
- .emotion-221::after {
2811
+ .emotion-222::after {
2812
2812
  content: '';
2813
2813
  margin-top: -0.2275em;
2814
2814
  display: block;
2815
2815
  }
2816
2816
  }
2817
2817
 
2818
- .emotion-224 {
2818
+ .emotion-225 {
2819
2819
  margin: 0;
2820
2820
  color: #0A0A0A;
2821
2821
  }
2822
2822
 
2823
- .emotion-224 svg {
2823
+ .emotion-225 svg {
2824
2824
  fill: #0A0A0A;
2825
2825
  }
2826
2826
 
2827
2827
  @media screen and (max-width: 767px) {
2828
- .emotion-224 {
2828
+ .emotion-225 {
2829
2829
  font-family: "DM Sans",sans-serif;
2830
2830
  font-size: 14px;
2831
2831
  line-height: 21px;
@@ -2834,13 +2834,13 @@ exports[`Article should render tile and sub title 1`] = `
2834
2834
  padding: 0.5px 0px;
2835
2835
  }
2836
2836
 
2837
- .emotion-224::before {
2837
+ .emotion-225::before {
2838
2838
  content: '';
2839
2839
  margin-bottom: -0.391em;
2840
2840
  display: block;
2841
2841
  }
2842
2842
 
2843
- .emotion-224::after {
2843
+ .emotion-225::after {
2844
2844
  content: '';
2845
2845
  margin-top: -0.409em;
2846
2846
  display: block;
@@ -2848,7 +2848,7 @@ exports[`Article should render tile and sub title 1`] = `
2848
2848
  }
2849
2849
 
2850
2850
  @media screen and (min-width: 768px) {
2851
- .emotion-224 {
2851
+ .emotion-225 {
2852
2852
  font-family: "DM Sans",sans-serif;
2853
2853
  font-size: 16px;
2854
2854
  line-height: 24px;
@@ -2857,13 +2857,13 @@ exports[`Article should render tile and sub title 1`] = `
2857
2857
  padding: 0.5px 0px;
2858
2858
  }
2859
2859
 
2860
- .emotion-224::before {
2860
+ .emotion-225::before {
2861
2861
  content: '';
2862
2862
  margin-bottom: -0.391em;
2863
2863
  display: block;
2864
2864
  }
2865
2865
 
2866
- .emotion-224::after {
2866
+ .emotion-225::after {
2867
2867
  content: '';
2868
2868
  margin-top: -0.409em;
2869
2869
  display: block;
@@ -2871,37 +2871,37 @@ exports[`Article should render tile and sub title 1`] = `
2871
2871
  }
2872
2872
 
2873
2873
  @media screen {
2874
- .emotion-240 {
2874
+ .emotion-242 {
2875
2875
  display: block;
2876
2876
  }
2877
2877
  }
2878
2878
 
2879
2879
  @media screen and (min-width: 480px) {
2880
- .emotion-240 {
2880
+ .emotion-242 {
2881
2881
  display: none;
2882
2882
  }
2883
2883
  }
2884
2884
 
2885
2885
  @media screen and (min-width: 768px) {
2886
- .emotion-240 {
2886
+ .emotion-242 {
2887
2887
  display: none;
2888
2888
  }
2889
2889
  }
2890
2890
 
2891
2891
  @media screen and (min-width: 1024px) {
2892
- .emotion-240 {
2892
+ .emotion-242 {
2893
2893
  display: block;
2894
2894
  }
2895
2895
  }
2896
2896
 
2897
2897
  @media screen and (min-width: 1440px) {
2898
- .emotion-240 {
2898
+ .emotion-242 {
2899
2899
  display: none;
2900
2900
  }
2901
2901
  }
2902
2902
 
2903
2903
  @media screen {
2904
- .emotion-253 {
2904
+ .emotion-255 {
2905
2905
  margin-bottom: 64px;
2906
2906
  }
2907
2907
  }
@@ -3740,7 +3740,7 @@ exports[`Article should render tile and sub title 1`] = `
3740
3740
  >
3741
3741
  <a
3742
3742
  class="nk-card-link emotion-166"
3743
- href="https://newskit.co.uk/"
3743
+ href="undefined"
3744
3744
  >
3745
3745
  <section
3746
3746
  class="emotion-167"
@@ -3791,7 +3791,7 @@ exports[`Article should render tile and sub title 1`] = `
3791
3791
  >
3792
3792
  <a
3793
3793
  class="nk-card-link emotion-166"
3794
- href="https://newskit.co.uk/"
3794
+ href="undefined"
3795
3795
  >
3796
3796
  <section
3797
3797
  class="emotion-167"
@@ -3991,21 +3991,26 @@ exports[`Article should render tile and sub title 1`] = `
3991
3991
  <div
3992
3992
  class="emotion-220"
3993
3993
  >
3994
- <section
3995
- class="emotion-221"
3994
+ <a
3995
+ class="nk-card-link emotion-166"
3996
+ href="undefined"
3996
3997
  >
3997
- <h6
3998
- class="nk-headline-heading emotion-8"
3998
+ <section
3999
+ class="emotion-222"
3999
4000
  >
4000
- Prince Harry
4001
- </h6>
4002
- </section>
4001
+ <h6
4002
+ class="nk-headline-heading emotion-168"
4003
+ >
4004
+ Prince Harry
4005
+ </h6>
4006
+ </section>
4007
+ </a>
4003
4008
  </div>
4004
4009
  <div
4005
4010
  class="emotion-220"
4006
4011
  >
4007
4012
  <p
4008
- class="emotion-224"
4013
+ class="emotion-225"
4009
4014
  >
4010
4015
  news
4011
4016
  </p>
@@ -4050,21 +4055,26 @@ exports[`Article should render tile and sub title 1`] = `
4050
4055
  <div
4051
4056
  class="emotion-220"
4052
4057
  >
4053
- <section
4054
- class="emotion-221"
4058
+ <a
4059
+ class="nk-card-link emotion-166"
4060
+ href="undefined"
4055
4061
  >
4056
- <h6
4057
- class="nk-headline-heading emotion-8"
4062
+ <section
4063
+ class="emotion-222"
4058
4064
  >
4059
- Meghan Markle
4060
- </h6>
4061
- </section>
4065
+ <h6
4066
+ class="nk-headline-heading emotion-168"
4067
+ >
4068
+ Meghan Markle
4069
+ </h6>
4070
+ </section>
4071
+ </a>
4062
4072
  </div>
4063
4073
  <div
4064
4074
  class="emotion-220"
4065
4075
  >
4066
4076
  <p
4067
- class="emotion-224"
4077
+ class="emotion-225"
4068
4078
  >
4069
4079
  news
4070
4080
  </p>
@@ -4078,7 +4088,7 @@ exports[`Article should render tile and sub title 1`] = `
4078
4088
  class="emotion-181"
4079
4089
  >
4080
4090
  <div
4081
- class="emotion-240"
4091
+ class="emotion-242"
4082
4092
  >
4083
4093
  <hr
4084
4094
  aria-hidden="true"
@@ -4148,7 +4158,7 @@ exports[`Article should render tile and sub title 1`] = `
4148
4158
  data-testid="PageLayout"
4149
4159
  >
4150
4160
  <div
4151
- class="emotion-253"
4161
+ class="emotion-255"
4152
4162
  />
4153
4163
  </div>
4154
4164
  </div>
@@ -1,3 +1,25 @@
1
+ describe('Account without user', () => {
2
+ beforeEach(() => {
3
+ cy.mockConsentAndVisit('/account')
4
+ })
5
+
6
+ it('Should Display default fallback values', () => {
7
+ cy.get('[data-testid="ContentListIntroduction"]').should('have.length', 3)
8
+ cy.get('[data-testid="ContentListItems"]').should('have.length', 3)
9
+ cy.contains('Please enter your name')
10
+ cy.contains('Please call customer service on xxxx-xxx-xxxx')
11
+ cy.contains('Please enter your display name')
12
+ cy.contains(
13
+ 'Your display name is used across our websites or apps when leaving comments on articles'
14
+ )
15
+ cy.contains('[email@address]')
16
+ cy.contains('******************')
17
+ cy.contains('Please enter your mobile telephone number')
18
+ cy.contains('Please enter your landline telephone number')
19
+ cy.contains('Please enter your address')
20
+ })
21
+ })
22
+
1
23
  describe('My account personal details', () => {
2
24
  beforeEach(() => {
3
25
  cy.GetAcsSession()
@@ -77,6 +99,10 @@ describe('My account personal details', () => {
77
99
  )
78
100
  })
79
101
 
102
+ it.only('Should Display date of birth', () => {
103
+ cy.contains('21/03/1988')
104
+ })
105
+
80
106
  it('Should go to edit page and change display name ', () => {
81
107
  cy.get('a[href="/account/edit/displayName"]')
82
108
  .should('be.visible')
@@ -176,7 +202,7 @@ describe('My account personal details', () => {
176
202
  .children()
177
203
  .should(
178
204
  'contain',
179
- 'Email sent to temp.account@tempaccount.com with a password reset link. If you haven’t received it in a couple of minutes, you may request a new link by clicking on the button below.'
205
+ 'Email sent to render.e2e.default@yopmail.com with a password reset link. If you haven’t received it in a couple of minutes, you may request a new link by clicking on the button below.'
180
206
  )
181
207
  })
182
208
 
@@ -21,7 +21,7 @@ describe('MAIN API', () => {
21
21
  cy.get('@mutateUser').then((updatedUser) => {
22
22
  expect(updatedUser.status).to.eq(200)
23
23
  expect(updatedUser.body.data.updateUser.email).to.eq(
24
- 'temp.account@tempaccount.com'
24
+ 'render.e2e.default@yopmail.com'
25
25
  )
26
26
  })
27
27
  })
@@ -43,7 +43,7 @@ describe('MAIN API', () => {
43
43
  cy.get('@mutateUser').then((updatedUser) => {
44
44
  expect(updatedUser.status).to.eq(200)
45
45
  expect(updatedUser.body.data.updateUser.email).to.eq(
46
- 'temp.account@tempaccount.com'
46
+ 'render.e2e.default@yopmail.com'
47
47
  )
48
48
  })
49
49
  })
@@ -63,7 +63,7 @@ describe('MAIN API', () => {
63
63
  }).as('user')
64
64
  cy.get('@user').then((response) => {
65
65
  expect(response.status).to.eq(200)
66
- expect(response.body.email).to.eq('temp.account@tempaccount.com')
66
+ expect(response.body.email).to.eq('render.e2e.default@yopmail.com')
67
67
  expect(response.body.mobile).to.eq('+447777777778')
68
68
  expect(response.body.firstName).to.eq('John')
69
69
  expect(response.body.lastName).to.eq('Smith')
@@ -85,7 +85,7 @@ describe('MAIN API', () => {
85
85
  }).as('userSubscription')
86
86
  cy.get('@userSubscription').then((response) => {
87
87
  expect(response.status).to.eq(200)
88
- expect(response.body.cpn).to.eq('4AAA038732032')
88
+ expect(response.body.cpn).to.eq('4AAA038765003')
89
89
  assert.isArray(response.body.subscriptions)
90
90
  })
91
91
  })
@@ -11,8 +11,8 @@ Cypress.Commands.add('mockConsent', () => {
11
11
 
12
12
  const userMap = {
13
13
  default: {
14
- username: 'temp.account@tempaccount.com',
15
- password: 'asdasd1A',
14
+ username: 'render.e2e.default@yopmail.com',
15
+ password: 'Ad45p0-swq151@',
16
16
  },
17
17
  noSub: {
18
18
  username: 'render.e2e.no-sub@yopmail.com',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newskit-render/core",
3
- "version": "1.44.2",
3
+ "version": "1.45.0",
4
4
  "description": "Newskit Render - Core package",
5
5
  "author": "",
6
6
  "license": "UNLICENSED",
@@ -33,13 +33,14 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@apollo/client": "3.4.16",
36
- "@newskit-render/api": "^0.18.0",
36
+ "@newskit-render/api": "^0.18.1",
37
37
  "@newskit-render/auth": "^0.31.3",
38
- "@newskit-render/checkout": "^0.26.3",
38
+ "@newskit-render/checkout": "^0.26.4",
39
39
  "@newskit-render/feature-flags": "^0.13.0",
40
- "@newskit-render/feed": "^0.5.2",
41
- "@newskit-render/my-account": "^0.152.0",
42
- "@newskit-render/shared-components": "^0.45.0",
40
+ "@newskit-render/feed": "^0.5.3",
41
+ "@newskit-render/my-account": "^0.152.4",
42
+ "@newskit-render/shared-components": "^0.45.1",
43
+ "@newskit-render/standalone-components": "^0.2.1",
43
44
  "@newskit-render/validation": "^0.39.1",
44
45
  "cross-fetch": "3.1.5",
45
46
  "graphql": "15.6.0",
@@ -4,11 +4,15 @@ import {
4
4
  createApolloClient,
5
5
  ClientTypes,
6
6
  getAcsCookie,
7
+ Publisher,
7
8
  } from '@newskit-render/api'
8
9
  import { UserData } from '@newskit-render/my-account'
10
+ import {
11
+ recommendationsProvider,
12
+ Article,
13
+ } from '@newskit-render/standalone-components'
9
14
  import { GET_UNIVERSAL_ARTICLE } from '../../../queries'
10
15
  import ArticlePage, { UniversalArticle } from '../../../components/article'
11
- import { highlights, relatedArticles } from '../../../helpers/mocks/articleMock'
12
16
  import { fetchUser } from '../../../helpers/getUser'
13
17
  import { ACCOUNT_QUERY_URL } from '../../../constants'
14
18
  import { addCacheHeaders } from '../../../helpers/addCacheHeaders'
@@ -20,6 +24,7 @@ export type ArticleSlug = {
20
24
  siteHost: string
21
25
  gscId?: string
22
26
  user?: UserData
27
+ recommendations: Article[]
23
28
  }
24
29
  const Article: React.FC<ArticleSlug> = ({
25
30
  universalArticle,
@@ -28,7 +33,11 @@ const Article: React.FC<ArticleSlug> = ({
28
33
  siteHost,
29
34
  gscId,
30
35
  user,
36
+ recommendations,
31
37
  }) => {
38
+ const highlitedArticles = recommendations.slice(0, 4)
39
+ const relatedArticles = recommendations.slice(4, 12)
40
+
32
41
  return (
33
42
  <ArticlePage
34
43
  articleURL={articleURL}
@@ -36,7 +45,7 @@ const Article: React.FC<ArticleSlug> = ({
36
45
  siteHost={siteHost}
37
46
  gscId={gscId}
38
47
  twitterUsername={twitterUsername}
39
- highlights={highlights}
48
+ highlights={highlitedArticles}
40
49
  relatedArticles={relatedArticles}
41
50
  user={user}
42
51
  />
@@ -57,11 +66,12 @@ export async function getServerSideProps(context) {
57
66
  `Article: /${section}/${articleId}/${articleSlug}`
58
67
  )
59
68
 
60
- const [{ data }, user] = await Promise.all([
69
+ const [{ data }, recommendations, user] = await Promise.all([
61
70
  apolloClient.query({
62
71
  query: GET_UNIVERSAL_ARTICLE,
63
72
  variables: { publisher: 'DEMO', id: articleId },
64
73
  }),
74
+ await recommendationsProvider({ articleId, publisher: Publisher.SUN_UK }),
65
75
  await fetchUser(acsCookie, ACCOUNT_QUERY_URL),
66
76
  ])
67
77
 
@@ -74,6 +84,7 @@ export async function getServerSideProps(context) {
74
84
  siteHost: process.env.SITE_HOST || '',
75
85
  gscId: process.env.GSC_ID || '',
76
86
  showAds: true,
87
+ recommendations,
77
88
  user,
78
89
  },
79
90
  }
@@ -1,10 +1,18 @@
1
1
  import { NextApiRequest, NextApiResponse } from 'next'
2
- import { newsSitemap, PublisherGroup } from '@newskit-render/feed'
2
+ import { newsSitemap } from '@newskit-render/feed'
3
+ import { Publisher } from '@newskit-render/api'
4
+
5
+ /* We do not have sitemap date for Demo so using Virgin,
6
+ * This can be removed and replace with just - publisher: process.env.PUBLISHER as PublisherGroup, in created projects
7
+ */
3
8
 
4
9
  const handler = async (req: NextApiRequest, res: NextApiResponse) =>
5
10
  newsSitemap({
6
11
  res,
7
- publisher: process.env.PUBLISHER as PublisherGroup,
12
+ publisher:
13
+ process.env.PUBLISHER === 'DEMO'
14
+ ? Publisher.VIRGIN
15
+ : (process.env.PUBLISHER as Publisher),
8
16
  domain: new URL(process.env.SITE_HOST as string).host,
9
17
  publicationName: process.env.SITEMAP_PUBLICATION_NAME as string,
10
18
  })
@@ -1,9 +1,10 @@
1
1
  import { NextApiRequest, NextApiResponse } from 'next'
2
- import {
3
- genericSitemap,
4
- PublisherGroup,
5
- CustomStaticPage,
6
- } from '@newskit-render/feed'
2
+ import { genericSitemap, CustomStaticPage } from '@newskit-render/feed'
3
+ import { Publisher } from '@newskit-render/api'
4
+
5
+ /* We do not have sitemap date for Demo so using Virgin,
6
+ * This can be removed and replace with just - publisher: process.env.PUBLISHER as PublisherGroup, in created projects
7
+ */
7
8
 
8
9
  const defaultCustomStaticPagesCollection: CustomStaticPage[] = [
9
10
  {
@@ -14,7 +15,10 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) =>
14
15
  genericSitemap({
15
16
  res,
16
17
  query: req.query,
17
- publisher: process.env.PUBLISHER as PublisherGroup,
18
+ publisher:
19
+ process.env.PUBLISHER === 'DEMO'
20
+ ? Publisher.VIRGIN
21
+ : (process.env.PUBLISHER as Publisher),
18
22
  domain: new URL(process.env.SITE_HOST as string).host,
19
23
  firstArticleDate: process.env.SITEMAP_FIRST_PUBLICATION_DATE as string,
20
24
  publicationName: process.env.SITEMAP_PUBLICATION_NAME as string,