Skip to content

feat(settings): display username on logout hover #969

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/routes/Settings.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ describe('routes/Settings.tsx', () => {

it('should press the logout', async () => {
const logoutMock = jest.fn();
let getByTitle;
let getByRole;

await act(async () => {
const { getByTitle: getByLabelTextLocal } = render(
const { getByRole: getByRoleLocal } = render(
<AppContext.Provider
value={{
settings: mockSettings,
Expand All @@ -64,10 +64,10 @@ describe('routes/Settings.tsx', () => {
</AppContext.Provider>,
);

getByTitle = getByLabelTextLocal;
getByRole = getByRoleLocal;
});

fireEvent.click(getByTitle('Logout'));
fireEvent.click(getByRole('Logout'));

expect(logoutMock).toHaveBeenCalledTimes(1);

Expand Down
8 changes: 6 additions & 2 deletions src/routes/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,14 @@ export const SettingsRoute: React.FC = () => {

<button
className={footerButtonClass}
title="Logout"
title={`Logout ${accounts.user.login}`}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about "Logout of "?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logout from?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

role="Logout"
onClick={logoutUser}
>
<SignOutIcon size={18} aria-label="Logout" />
<SignOutIcon
size={18}
aria-label={`Logout ${accounts.user.login}`}
/>
</button>

<button
Expand Down
5 changes: 3 additions & 2 deletions src/routes/__snapshots__/Settings.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -389,10 +389,11 @@ exports[`routes/Settings.tsx should render itself & its children 1`] = `
</button>
<button
class="hover:text-gray-500 py-1 px-2 my-1 mx-2 focus:outline-none"
title="Logout"
role="Logout"
title="Logout octocat"
>
<svg
aria-label="Logout"
aria-label="Logout octocat"
class="octicon octicon-sign-out"
fill="currentColor"
focusable="false"
Expand Down