diff --git a/src/renderer/__mocks__/partial-mocks.ts b/src/renderer/__mocks__/partial-mocks.ts
index 5db97d316..04ff306bc 100644
--- a/src/renderer/__mocks__/partial-mocks.ts
+++ b/src/renderer/__mocks__/partial-mocks.ts
@@ -13,6 +13,7 @@ export function partialMockNotification(
hostname: Constants.GITHUB_API_BASE_URL as Hostname,
token: mockToken,
user: mockGitifyUser,
+ hasRequiredScopes: true,
},
subject: subject as Subject,
};
diff --git a/src/renderer/__mocks__/state-mocks.ts b/src/renderer/__mocks__/state-mocks.ts
index 4b3eb4232..c88b8f460 100644
--- a/src/renderer/__mocks__/state-mocks.ts
+++ b/src/renderer/__mocks__/state-mocks.ts
@@ -34,6 +34,7 @@ export const mockPersonalAccessTokenAccount: Account = {
token: 'token-123-456' as Token,
hostname: Constants.DEFAULT_AUTH_OPTIONS.hostname,
user: mockGitifyUser,
+ hasRequiredScopes: true,
};
export const mockOAuthAccount: Account = {
@@ -42,6 +43,7 @@ export const mockOAuthAccount: Account = {
token: '1234568790' as Token,
hostname: 'github.gitify.io' as Hostname,
user: mockGitifyUser,
+ hasRequiredScopes: true,
};
export const mockGitHubCloudAccount: Account = {
@@ -51,6 +53,7 @@ export const mockGitHubCloudAccount: Account = {
hostname: Constants.DEFAULT_AUTH_OPTIONS.hostname,
user: mockGitifyUser,
version: 'latest',
+ hasRequiredScopes: true,
};
export const mockGitHubEnterpriseServerAccount: Account = {
@@ -59,6 +62,7 @@ export const mockGitHubEnterpriseServerAccount: Account = {
token: '1234568790' as Token,
hostname: 'github.gitify.io' as Hostname,
user: mockGitifyUser,
+ hasRequiredScopes: true,
};
export const mockGitHubAppAccount: Account = {
@@ -67,6 +71,7 @@ export const mockGitHubAppAccount: Account = {
token: '987654321' as Token,
hostname: Constants.DEFAULT_AUTH_OPTIONS.hostname,
user: mockGitifyUser,
+ hasRequiredScopes: true,
};
export const mockAuth: AuthState = {
diff --git a/src/renderer/routes/Accounts.test.tsx b/src/renderer/routes/Accounts.test.tsx
index e2b23052f..e06fd5486 100644
--- a/src/renderer/routes/Accounts.test.tsx
+++ b/src/renderer/routes/Accounts.test.tsx
@@ -57,6 +57,45 @@ describe('renderer/routes/Accounts.tsx', () => {
expect(screen.getByTestId('accounts')).toMatchSnapshot();
});
+ it('should render with PAT scopes warning', async () => {
+ const openExternalLinkMock = jest
+ .spyOn(comms, 'openExternalLink')
+ .mockImplementation();
+
+ await act(async () => {
+ render(
+