Skip to content

Commit 7e97461

Browse files
committed
Fix tests
1 parent 41b79d0 commit 7e97461

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

site/src/components/BuildsTable/BuildRow.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ export const BuildRow: React.FC<BuildRowProps> = ({ build }) => {
2323
return (
2424
<TableRow
2525
hover
26-
key={build.id}
2726
data-testid={`build-${build.id}`}
2827
className={styles.buildRow}
2928
>

site/src/components/BuildsTable/BuildsTable.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import TableBody from "@material-ui/core/TableBody"
44
import TableCell from "@material-ui/core/TableCell"
55
import TableContainer from "@material-ui/core/TableContainer"
66
import TableRow from "@material-ui/core/TableRow"
7-
import { FC } from "react"
7+
import { FC, Fragment } from "react"
88
import * as TypesGen from "../../api/typesGenerated"
99
import { EmptyState } from "../EmptyState/EmptyState"
1010
import { TableLoader } from "../TableLoader/TableLoader"
@@ -64,12 +64,12 @@ export const BuildsTable: FC<React.PropsWithChildren<BuildsTableProps>> = ({
6464
const builds = buildsByDate[dateStr]
6565

6666
return (
67-
<>
67+
<Fragment key={dateStr}>
6868
<BuildDateRow date={new Date(dateStr)} />
6969
{builds.map((build) => (
7070
<BuildRow key={build.id} build={build} />
7171
))}
72-
</>
72+
</Fragment>
7373
)
7474
})}
7575

site/src/pages/WorkspacePage/WorkspacePage.test.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,8 @@ describe("WorkspacePage", () => {
288288
// Wait for the results to be loaded
289289
await waitFor(async () => {
290290
const rows = table.querySelectorAll("tbody > tr")
291-
expect(rows).toHaveLength(MockBuilds.length)
291+
// Added +1 because of the date row
292+
expect(rows).toHaveLength(MockBuilds.length + 1)
292293
})
293294
})
294295
})

0 commit comments

Comments
 (0)