Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
gabalafou committed Mar 5, 2024
1 parent c8f99b9 commit 4517804
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/features/metadata/components/EnvBuilds.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export const EnvBuilds = ({
/>
)) ||
// If the selected build is a failed build, render the link to the build log.
(showLogLink && [". ", logLink])}
(showLogLink && <>. {logLink}</>)}
</Typography>
</StyledMetadataItem>
</>
Expand Down
28 changes: 24 additions & 4 deletions test/metadata/EnvBuilds.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ describe("<EnvBuilds />", () => {
it("should render component", () => {
const component = render(
<Provider store={store}>
<EnvBuilds selectedBuildId={1} builds={[BUILD]} />
<EnvBuilds
currentBuildId={1}
selectedBuildId={1}
builds={[BUILD]}
mode="read-only"
/>
</Provider>
);
expect(component.container).toHaveTextContent("Builds");
Expand All @@ -18,7 +23,12 @@ describe("<EnvBuilds />", () => {
it("should show a progress bar if builds are not available", () => {
const component = render(
<Provider store={store}>
<EnvBuilds selectedBuildId={1} builds={[]} />
<EnvBuilds
currentBuildId={1}
selectedBuildId={1}
builds={[]}
mode="read-only"
/>
</Provider>
);
const progressBar = component.getByRole("progressbar");
Expand All @@ -29,7 +39,12 @@ describe("<EnvBuilds />", () => {
const failedBuild = { ...BUILD, status: "FAILED" };
const { getByTestId, getByRole } = render(
<Provider store={store}>
<EnvBuilds selectedBuildId={1} builds={[failedBuild]} />
<EnvBuilds
currentBuildId={1}
selectedBuildId={1}
builds={[failedBuild]}
mode="read-only"
/>
</Provider>
);
expect(getByRole("link", { name: "Log" })).toBeInTheDocument();
Expand All @@ -41,7 +56,12 @@ describe("<EnvBuilds />", () => {
it("should not render log link for normal build", () => {
const { getByTestId, queryByRole } = render(
<Provider store={store}>
<EnvBuilds selectedBuildId={1} builds={[BUILD]} />
<EnvBuilds
currentBuildId={1}
selectedBuildId={1}
builds={[BUILD]}
mode="read-only"
/>
</Provider>
);
expect(queryByRole("link", { name: "Log" })).not.toBeInTheDocument();
Expand Down
3 changes: 2 additions & 1 deletion test/testutils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ export const BUILD = {
scheduled_on: "2022-11-08T14:28:05.655564",
started_on: "2022-11-08T14:28:05.655564",
ended_on: "2022-11-08T14:28:05.655564",
build_artifacts: []
build_artifacts: [],
status_info: null
};

export const mockTheme = (children: any) => {
Expand Down

0 comments on commit 4517804

Please sign in to comment.