Skip to content

Commit bf25791

Browse files
committed
test(stories card): update tests - new common item
1 parent c630a43 commit bf25791

File tree

3 files changed

+101
-86
lines changed

3 files changed

+101
-86
lines changed

clients/web/src/containers/collections/stories-page/card.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ describe('ItemCard', () => {
2121

2222
it('renders a story', () => {
2323
const { getByTestId } = render(<StoryCard id={derivedStory.itemId} position={3} />, { initialState }) //prettier-ignore
24-
expect(getByTestId('article-card-', { exact: false })).toMatchSnapshot()
24+
expect(getByTestId('article-card', { exact: false })).toMatchSnapshot()
2525
})
2626
})

clients/web/src/containers/collections/stories-page/card.spec.js.snap

+100-82
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,20 @@
22

33
exports[`ItemCard renders a story 1`] = `
44
<article
5-
class="css-17xj56a grid noExcerpt"
6-
data-testid="article-card-1731163180"
5+
class="css-1si58nt wide"
6+
data-testid="article-card"
77
>
8-
<div
9-
class="selectedBack"
10-
/>
11-
<div
12-
class="cardWrap"
8+
<span
9+
class="media-block"
1310
>
1411
<div
15-
class="css-1v4yrya media"
12+
class="css-dwpxoa media"
1613
>
1714
<a
1815
data-testid="image-link"
1916
href="https://www.nytimes.com/2017/05/06/business/inside-vws-campaign-of-trickery.html?utm_source=pocket_collection_story"
20-
rel="noopener"
17+
rel="noopner"
2118
tabindex="-1"
22-
target="_blank"
2319
>
2420
<img
2521
alt=""
@@ -29,51 +25,70 @@ exports[`ItemCard renders a story 1`] = `
2925
/>
3026
</a>
3127
</div>
32-
<div
33-
class="content"
28+
</span>
29+
<div
30+
class="item-links"
31+
>
32+
<a
33+
class="content-block"
34+
data-testid="content-block"
35+
href="https://www.nytimes.com/2017/05/06/business/inside-vws-campaign-of-trickery.html?utm_source=pocket_collection_story"
36+
rel="noopener"
37+
target="_blank"
3438
>
35-
<h2
36-
class="title open-external"
39+
<div
40+
class="content"
3741
>
38-
<a
39-
data-testid="title-link"
40-
href="https://www.nytimes.com/2017/05/06/business/inside-vws-campaign-of-trickery.html?utm_source=pocket_collection_story"
41-
rel="noopener"
42-
tabindex="0"
43-
target="_blank"
44-
>
45-
Inside VW’s Campaign of Trickery
46-
</a>
47-
<svg
48-
aria-hidden="true"
49-
class="icon mobile-view-original"
50-
data-testid="view-original-icon"
51-
fill="currentColor"
52-
viewBox="0 0 24 24"
53-
xmlns="http://www.w3.org/2000/svg"
42+
<h2
43+
class="title open-external"
5444
>
55-
<path
56-
clip-rule="evenodd"
57-
d="M6 4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-3a1 1 0 1 1 2 0v3a4 4 0 0 1-4 4H6a4 4 0 0 1-4-4V6a4 4 0 0 1 4-4h3a1 1 0 0 1 0 2z"
58-
fill-rule="evenodd"
59-
/>
60-
<path
61-
clip-rule="evenodd"
62-
d="M13 3a1 1 0 0 1 1-1h7a1 1 0 0 1 1 1v7a1 1 0 1 1-2 0V5.414l-7.293 7.293a1 1 0 0 1-1.414-1.414L18.586 4H14a1 1 0 0 1-1-1"
63-
fill-rule="evenodd"
64-
/>
65-
</svg>
66-
</h2>
67-
<cite
68-
class="details"
69-
>
45+
<span
46+
class="text"
47+
>
48+
Inside VW’s Campaign of Trickery
49+
</span>
50+
<svg
51+
aria-hidden="true"
52+
class="icon mobile-view-original"
53+
data-testid="view-original-icon"
54+
fill="currentColor"
55+
viewBox="0 0 24 24"
56+
xmlns="http://www.w3.org/2000/svg"
57+
>
58+
<path
59+
clip-rule="evenodd"
60+
d="M6 4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-3a1 1 0 1 1 2 0v3a4 4 0 0 1-4 4H6a4 4 0 0 1-4-4V6a4 4 0 0 1 4-4h3a1 1 0 0 1 0 2z"
61+
fill-rule="evenodd"
62+
/>
63+
<path
64+
clip-rule="evenodd"
65+
d="M13 3a1 1 0 0 1 1-1h7a1 1 0 0 1 1 1v7a1 1 0 1 1-2 0V5.414l-7.293 7.293a1 1 0 0 1-1.414-1.414L18.586 4H14a1 1 0 0 1-1-1"
66+
fill-rule="evenodd"
67+
/>
68+
</svg>
69+
</h2>
7070
<div
71-
class="authors"
71+
class="excerpt"
7272
>
73-
<span>
74-
Jack Ewing
75-
</span>
73+
**SS**: “One of the guests in our Volkswagen episode was *New York Times* reporter Jack Ewing. Jack knows everything about VW, and it’s always wonderful to have the most authoritative voices on our show. He described for us what it’s like to visit VW’s headquarters in Germany, and talked about the company’s complicated history there. He also covered the VW emissions scandal from its beginning; you can read an excerpt of his book in this *NYT* article.”
7674
</div>
75+
</div>
76+
</a>
77+
</div>
78+
<footer
79+
class="footer"
80+
>
81+
<cite
82+
class="details"
83+
>
84+
<div
85+
class="authors"
86+
>
87+
<span>
88+
Jack Ewing
89+
</span>
90+
</div>
91+
<div>
7792
<a
7893
class="publisher"
7994
data-testid="publisher-link"
@@ -83,43 +98,46 @@ exports[`ItemCard renders a story 1`] = `
8398
>
8499
New York Times
85100
</a>
86-
</cite>
87-
</div>
88-
</div>
89-
<footer
90-
class="footer"
91-
>
101+
</div>
102+
<div
103+
class="context"
104+
/>
105+
</cite>
92106
<div
93-
class="css-dz1tot actions"
107+
class="footer-actions"
94108
>
95-
<button
96-
class="unsaved card-actions forceWidth css-1sh3voc"
97-
data-testid="article-save-btn-1731163180"
109+
<div
110+
class="css-dz1tot actions"
98111
>
99-
<svg
100-
aria-hidden="true"
101-
class="icon "
102-
fill="currentColor"
103-
viewBox="0 0 24 24"
104-
xmlns="http://www.w3.org/2000/svg"
112+
<button
113+
class="unsaved card-actions forceWidth css-1sh3voc"
114+
data-testid="article-save-btn-1731163180"
105115
>
106-
<path
107-
clip-rule="evenodd"
108-
d="M2 5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2H2m2 0H2v6c0 5.523 4.477 10 10 10s10-4.477 10-10V5h-2v6a8 8 0 1 1-16 0z"
109-
fill-rule="evenodd"
110-
/>
111-
<path
112-
clip-rule="evenodd"
113-
d="M7.293 9.293a1 1 0 0 1 1.414 0L12 12.586l3.293-3.293a1 1 0 1 1 1.414 1.414l-4 4a1 1 0 0 1-1.414 0l-4-4a1 1 0 0 1 0-1.414"
114-
fill-rule="evenodd"
115-
/>
116-
</svg>
117-
<div
118-
class="actionCopy"
119-
>
120-
item-action:save-unsaved
121-
</div>
122-
</button>
116+
<svg
117+
aria-hidden="true"
118+
class="icon "
119+
fill="currentColor"
120+
viewBox="0 0 24 24"
121+
xmlns="http://www.w3.org/2000/svg"
122+
>
123+
<path
124+
clip-rule="evenodd"
125+
d="M2 5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2H2m2 0H2v6c0 5.523 4.477 10 10 10s10-4.477 10-10V5h-2v6a8 8 0 1 1-16 0z"
126+
fill-rule="evenodd"
127+
/>
128+
<path
129+
clip-rule="evenodd"
130+
d="M7.293 9.293a1 1 0 0 1 1.414 0L12 12.586l3.293-3.293a1 1 0 1 1 1.414 1.414l-4 4a1 1 0 0 1-1.414 0l-4-4a1 1 0 0 1 0-1.414"
131+
fill-rule="evenodd"
132+
/>
133+
</svg>
134+
<div
135+
class="actionCopy"
136+
>
137+
item-action:save-unsaved
138+
</div>
139+
</button>
140+
</div>
123141
</div>
124142
</footer>
125143
</article>

ui/components/__snapshots__/item-article.ts.snap

-3
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ exports[`renders Item with expected data 1`] = `
4141
</p>
4242
</div>
4343
<footer>
44-
<cite>
45-
Slate
46-
</cite>
4744
<div
4845
class="base"
4946
data-testid="item-actions"

0 commit comments

Comments
 (0)