Skip to content

Commit a9e1391

Browse files
authored
Merge pull request #745 from zendesk/melreal/fix-requester
fix: show requester name when empty string alias
2 parents 13f7f9a + 37c886a commit a9e1391

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

assets/request-list-bundle.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/modules/request-list/components/requests-table/requests-table-row/RequestsTableCell.test.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,15 @@ describe("RequestsTableCell", () => {
180180
screen.getAllByText("Baby", { exact: false })[0]
181181
).toBeInTheDocument();
182182
});
183+
184+
test("renders requester name when alias is empty", () => {
185+
const userWithEmptyAlias = { ...mockAliasUser, alias: "" };
186+
renderCell({ identifier: "requester", user: userWithEmptyAlias });
187+
188+
expect(
189+
screen.getAllByText("Paolo", { exact: false })[0]
190+
).toBeInTheDocument();
191+
});
183192
});
184193

185194
describe("Custom field rendering", () => {

src/modules/request-list/components/requests-table/requests-table-row/RequestsTableCell.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ The same applies for the description. */
179179
}
180180

181181
if (identifier === "requester") {
182-
const nameOrAlias = user?.alias === undefined ? user?.name : user?.alias;
182+
const nameOrAlias = user?.alias || user?.name;
183183

184184
return (
185185
<TruncatedTableCell identifier={identifier}>

0 commit comments

Comments
 (0)