Skip to content

Commit 98f04fe

Browse files
update streamfeed tests for new hero section
1 parent 708367d commit 98f04fe

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

cypress/e2e/streamfeed.cy.js

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,36 @@ describe('twitch-app contains valid streamfeed', () => {
66
})
77

88
it('shows default heading', () => {
9-
cy.get('[data-testid="streamfeed-heading"]').should('have.length', 1)
9+
cy.get('[data-testid="streamfeed-heading-1"]').should('have.length', 1)
1010

11-
cy.get('[data-testid="streamfeed-heading"]')
11+
cy.get('[data-testid="streamfeed-heading-1"]')
1212
.children()
1313
.should('have.length', 2)
14+
15+
cy.get('[data-testid="streamfeed-heading-2"]').should('have.length', 1)
16+
17+
cy.get('[data-testid="streamfeed-heading-2"]')
18+
.children()
19+
.should('have.length', 3)
1420
})
1521

1622
it('contains correct default heading content', () => {
17-
cy.get('[data-testid="streamfeed-heading"]')
23+
cy.get('[data-testid="streamfeed-heading-1"]')
24+
.children()
25+
.eq(0)
26+
.contains('Current')
27+
28+
cy.get('[data-testid="streamfeed-heading-1"]')
29+
.children()
30+
.eq(1)
31+
.contains('Top Livestream')
32+
33+
cy.get('[data-testid="streamfeed-heading-2"]')
1834
.children()
1935
.eq(0)
2036
.contains('German Livestreams')
2137

22-
cy.get('[data-testid="streamfeed-heading"]')
38+
cy.get('[data-testid="streamfeed-heading-2"]')
2339
.children()
2440
.eq(1)
2541
.contains('you might like')
@@ -38,7 +54,7 @@ describe('twitch-app contains valid streamfeed', () => {
3854

3955
cy.get('[data-testid="streamfeed-article-0"]')
4056
.children()
41-
.should('have.length', 2)
57+
.should('have.length', 3)
4258

4359
cy.get('[data-testid="streamfeed-thumbnail-0').should('have.length', 1)
4460

src/components/streamFeed/StreamHero.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const StreamHero = ({ bgColors, filteredStreamData }: StreamHeroProps) => {
2323
<>
2424
<h1
2525
className="w-full lg:w-4/5 max-w-6xl m-auto pt-4 text-2xl lg:text-3xl"
26-
data-testid="streamfeed-heading-2"
26+
data-testid="streamfeed-heading-1"
2727
>
2828
<span className="text-slate-300">Current</span>
2929
<span className="text-purple-400"> Top Livestream</span>

0 commit comments

Comments
 (0)