Skip to content

Commit

Permalink
[pre-commit.ci] Add auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 27, 2024
1 parent fcda5e8 commit bde1f83
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
15 changes: 6 additions & 9 deletions florist/app/jobs/details/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,10 @@ export function JobProgressBar({
status,
clientIndex,
}: {
metrics: string,
totalEpochs: number,
status: status,
clientIndex: number,
metrics: string;
totalEpochs: number;
status: status;
clientIndex: number;
}): ReactElement {
const [collapsed, setCollapsed] = useState(true);

Expand Down Expand Up @@ -276,17 +276,15 @@ export function JobProgressBar({
</div>
</div>
<div className="row pb-2">
{!collapsed ? (
<JobProgressDetails metrics={metricsJson} clientIndex={clientIndex}/>
) : null}
{!collapsed ? <JobProgressDetails metrics={metricsJson} clientIndex={clientIndex} /> : null}
</div>
</div>
</div>
</div>
);
}

export function JobProgressDetails({ metrics, clientIndex }: { metrics: Object, clientIndex: number }): ReactElement {
export function JobProgressDetails({ metrics, clientIndex }: { metrics: Object; clientIndex: number }): ReactElement {
if (!metrics) {
return null;
}
Expand Down Expand Up @@ -362,7 +360,6 @@ export function JobProgressDetails({ metrics, clientIndex }: { metrics: Object,
</a>
</div>
</div>

</div>
);
}
Expand Down
13 changes: 10 additions & 3 deletions florist/tests/unit/app/jobs/details/page.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -515,15 +515,22 @@ describe("Job Details Page", () => {
];
act(() => toggleButton.click());

const expectedClientMetrics = JSON.stringify(JSON.parse(testJob.clients_info[testClientIndex].metrics), null, 4);
const expectedClientMetrics = JSON.stringify(
JSON.parse(testJob.clients_info[testClientIndex].metrics),
null,
4,
);
expect(urlSpy.createObjectURL).toHaveBeenCalledWith(new Blob([expectedClientMetrics]));

const clientProgressDetailsComponent = container.querySelector(
`#job-details-client-config-progress-${testClientIndex} .job-progress-detail`,
);
const downloadMetricsButton = clientProgressDetailsComponent.querySelector(".download-metrics-button");
const downloadMetricsButton =
clientProgressDetailsComponent.querySelector(".download-metrics-button");
expect(downloadMetricsButton.getAttribute("href")).toBe(testURL);
expect(downloadMetricsButton.getAttribute("download")).toBe(`client-metrics-${testClientIndex}.json`);
expect(downloadMetricsButton.getAttribute("download")).toBe(
`client-metrics-${testClientIndex}.json`,
);
});
});
describe("Clients", () => {
Expand Down

0 comments on commit bde1f83

Please sign in to comment.