Skip to content

Commit 81b33ca

Browse files
committed
test(tags): reverted tag ID to row index
1 parent 8ac5709 commit 81b33ca

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

packages/library/src/modules/Tags/Tags.spec.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import * as gitContext from 'context/GitContext'
22
import { commit, gitContextBag, graphData } from 'test/stubs'
33
import { Tags } from './Tags'
4-
import { render, screen } from '@testing-library/react'
4+
import { render } from '@testing-library/react'
55
import { CommitNodeLocation } from 'data'
6+
import { tag } from 'test/elements/Tag'
67

78
describe('Tags', () => {
89
it('should render a tag for the row that has the selected commit', () => {
@@ -24,7 +25,7 @@ describe('Tags', () => {
2425

2526
render(<Tags />)
2627

27-
expect(screen.getByTestId('tag-selected')).toBeInTheDocument()
28+
expect(tag.atRow({ row: 0 })).toBeInTheDocument()
2829
})
2930

3031
it('should render a tag for the row that has the previewed commit', () => {
@@ -46,6 +47,6 @@ describe('Tags', () => {
4647

4748
render(<Tags />)
4849

49-
expect(screen.getByTestId('tag-previewed')).toBeInTheDocument()
50+
expect(tag.atRow({ row: 0 })).toBeInTheDocument()
5051
})
5152
})

packages/library/src/modules/Tags/Tags.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export const Tags = () => {
8383
return (
8484
<BranchTag
8585
commit={commit}
86-
id={commit.hash}
86+
id={i.toString()}
8787
key={`tag_${commit.hash}`}
8888
height={ROW_HEIGHT + rowSpacing}
8989
lineWidth={tagLineWidth(commit)}

0 commit comments

Comments
 (0)