Skip to content

Commit

Permalink
fix issue for optional string overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
Pooja17-bentley committed Nov 10, 2023
1 parent 65b7a2d commit 97c6713
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ describe("ChangesTab", () => {
within(cells[5] as HTMLElement).getByTitle(
defaultStrings.createNamedVersion
);
within(cells[5] as HTMLElement).getByTitle(
defaultStrings.informationPanel
);
within(cells[5] as HTMLElement).getByTitle("Information Panel");
});
});

Expand Down Expand Up @@ -103,9 +101,7 @@ describe("ChangesTab", () => {
changesets: MockedChangesetList(),
});
const rowgroup = screen.getAllByRole("rowgroup")[0];
const infoIcons = within(rowgroup).queryAllByTitle(
defaultStrings.informationPanel
);
const infoIcons = within(rowgroup).queryAllByTitle("Information Panel");
const rows = within(rowgroup).queryAllByRole("row");

expect(infoIcons.length).toBe(rows.length);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const ChangesTab = (props: ChangesTabProps) => {
},
{
id: "CREATOR",
Header: stringsOverrides.user,
Header: stringsOverrides.user ?? "User",
accessor: "createdBy",
maxWidth: 220,
Cell: (props: CellProps<Changeset>) => {
Expand Down Expand Up @@ -130,7 +130,9 @@ const ChangesTab = (props: ChangesTabProps) => {
<SvgNamedVersionAdd />
</IconButton>
<IconButton
title={stringsOverrides.informationPanel}
title={
stringsOverrides.informationPanel ?? "Information Panel"
}
styleType="borderless"
onClick={() => handleInfoPanelOpen(changeset)}
size="small"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,7 @@ describe("ManageVersions", () => {
within(cells[5] as HTMLElement).getByTitle(
defaultStrings.createNamedVersion
);
within(cells[5] as HTMLElement).getByTitle(
defaultStrings.informationPanel
);
within(cells[5] as HTMLElement).getByTitle("Information Panel");
});
expect(mockGetChangesets).toHaveBeenCalledWith(MOCKED_IMODEL_ID, {
top: 100,
Expand Down Expand Up @@ -317,7 +315,7 @@ it("should render with changesets tab opened", async () => {
within(cells[5] as HTMLElement).getByTitle(
defaultStrings.createNamedVersion
);
within(cells[5] as HTMLElement).getByTitle(defaultStrings.informationPanel);
within(cells[5] as HTMLElement).getByTitle("Information Panel");
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const VersionsTab = (props: VersionsTabProps) => {
},
{
id: "CREATOR",
Header: stringsOverrides.user,
Header: stringsOverrides.user ?? "User",
accessor: "createdBy",
maxWidth: 220,
Cell: (props: CellProps<NamedVersion>) => {
Expand Down

0 comments on commit 97c6713

Please sign in to comment.