Skip to content

Commit f231de5

Browse files
committed
test: update test cases
Signed-off-by: Adam Setch <[email protected]>
1 parent 706f570 commit f231de5

File tree

8 files changed

+317
-399
lines changed

8 files changed

+317
-399
lines changed

src/renderer/components/notifications/AccountNotifications.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export const AccountNotifications: FC<IAccountNotifications> = (
7777
{showAccountHeader && (
7878
<div
7979
className={cn(
80-
'group flex items-center justify-between pr-3 py-1.5 text-sm font-semibold dark:text-white',
80+
'group flex items-center justify-between pl-3 pr-1 py-0.5 text-sm font-semibold dark:text-white',
8181
props.error
8282
? 'bg-red-300 dark:bg-red-500'
8383
: 'bg-gray-300 dark:bg-gray-darkest',

src/renderer/components/notifications/NotificationFooter.tsx

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -27,30 +27,28 @@ export const NotificationFooter: FC<INotificationFooter> = ({
2727

2828
return (
2929
<div className="flex flex-wrap items-center gap-1">
30-
<div className="mb-1">
31-
{notification.subject.user ? (
32-
<Avatar
33-
title={`View profile: ${notification.subject.user.login}`}
34-
src={notification.subject.user.avatar_url}
35-
size={Size.SMALL}
36-
onClick={(event: MouseEvent<HTMLElement>) => {
37-
// Don't trigger onClick of parent element.
38-
event.stopPropagation();
39-
openUserProfile(notification.subject.user);
40-
}}
41-
data-testid="view-profile"
42-
/>
43-
) : (
44-
<div>
45-
{notification.subject.type === 'RepositoryDependabotAlertsThread' ||
46-
notification.subject.type === 'RepositoryVulnerabilityAlert' ? (
47-
<MarkGithubIcon size={Size.SMALL} />
48-
) : (
49-
<FeedPersonIcon size={Size.SMALL} className={IconColor.GRAY} />
50-
)}
51-
</div>
52-
)}
53-
</div>
30+
{notification.subject.user ? (
31+
<Avatar
32+
title={`View profile: ${notification.subject.user.login}`}
33+
src={notification.subject.user.avatar_url}
34+
size={Size.SMALL}
35+
onClick={(event: MouseEvent<HTMLElement>) => {
36+
// Don't trigger onClick of parent element.
37+
event.stopPropagation();
38+
openUserProfile(notification.subject.user);
39+
}}
40+
data-testid="view-profile"
41+
/>
42+
) : (
43+
<span>
44+
{notification.subject.type === 'RepositoryDependabotAlertsThread' ||
45+
notification.subject.type === 'RepositoryVulnerabilityAlert' ? (
46+
<MarkGithubIcon size={Size.SMALL} />
47+
) : (
48+
<FeedPersonIcon size={Size.SMALL} className={IconColor.GRAY} />
49+
)}
50+
</span>
51+
)}
5452
<span
5553
className={cn('text-xs capitalize', Opacity.MEDIUM)}
5654
title={reason.description}

src/renderer/components/notifications/NotificationRow.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export const NotificationRow: FC<INotificationRow> = ({
9090
<div
9191
id={notification.id}
9292
className={cn(
93-
'group flex border-b border-gray-100 bg-white px-3 py-2 hover:bg-gray-100 dark:border-gray-darker dark:bg-gray-dark dark:text-white dark:hover:bg-gray-darker',
93+
'group flex border-b border-gray-100 bg-white pl-3 pr-1 py-1.5 hover:bg-gray-100 dark:border-gray-darker dark:bg-gray-dark dark:text-white dark:hover:bg-gray-darker',
9494
(isAnimated || animateExit) &&
9595
'translate-x-full opacity-0 transition duration-[350ms] ease-in-out',
9696
(isRead || showAsRead) && Opacity.READ,

src/renderer/components/notifications/RepositoryNotifications.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ export const RepositoryNotifications: FC<IRepositoryNotifications> = ({
5353
return (
5454
<>
5555
<div
56-
className="group flex justify-between bg-gray-100 pr-3 py-1.5 dark:bg-gray-darker dark:text-white"
56+
className="group flex justify-between bg-gray-100 pl-3 pr-1 py-0.5 dark:bg-gray-darker dark:text-white"
5757
onClick={toggleRepositoryNotifications}
5858
>
5959
<div
6060
className={cn(
6161
'flex flex-1 gap-3 items-center truncate text-sm font-medium',
6262
animateExit &&
6363
'translate-x-full opacity-0 transition duration-[350ms] ease-in-out',
64-
showAsRead ? Opacity.READ : Opacity.MEDIUM,
64+
showAsRead && Opacity.READ,
6565
)}
6666
>
6767
<Tooltip text="Open repository" direction="e">

src/renderer/components/notifications/__snapshots__/AccountNotifications.test.tsx.snap

Lines changed: 71 additions & 87 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)