@@ -5,6 +5,7 @@ import nock from 'nock';
55import { mockGitHubCloudAccount } from '../../__mocks__/account-mocks' ;
66import { mockAuth } from '../../__mocks__/state-mocks' ;
77import { mockGitifyUser } from '../../__mocks__/user-mocks' ;
8+ import { Constants } from '../../constants' ;
89import type {
910 Account ,
1011 AuthCode ,
@@ -153,7 +154,11 @@ describe('renderer/utils/auth/utils.ts', () => {
153154 beforeEach ( ( ) => {
154155 nock ( 'https://api.github.com' )
155156 . get ( '/user' )
156- . reply ( 200 , { ...mockGitifyUser , avatar_url : mockGitifyUser . avatar } ) ;
157+ . reply (
158+ 200 ,
159+ { ...mockGitifyUser , avatar_url : mockGitifyUser . avatar } ,
160+ { 'x-oauth-scopes' : Constants . OAUTH_SCOPES . RECOMMENDED } ,
161+ ) ;
157162 } ) ;
158163
159164 it ( 'should add personal access token account' , async ( ) => {
@@ -166,6 +171,7 @@ describe('renderer/utils/auth/utils.ts', () => {
166171
167172 expect ( result . accounts ) . toEqual ( [
168173 {
174+ hasRequiredScopes : true ,
169175 hostname : 'github.com' as Hostname ,
170176 method : 'Personal Access Token' ,
171177 platform : 'GitHub Cloud' ,
@@ -186,6 +192,7 @@ describe('renderer/utils/auth/utils.ts', () => {
186192
187193 expect ( result . accounts ) . toEqual ( [
188194 {
195+ hasRequiredScopes : true ,
189196 hostname : 'github.com' as Hostname ,
190197 method : 'OAuth App' ,
191198 platform : 'GitHub Cloud' ,
@@ -204,7 +211,10 @@ describe('renderer/utils/auth/utils.ts', () => {
204211 . reply (
205212 200 ,
206213 { ...mockGitifyUser , avatar_url : mockGitifyUser . avatar } ,
207- { 'x-github-enterprise-version' : '3.0.0' } ,
214+ {
215+ 'x-github-enterprise-version' : '3.0.0' ,
216+ 'x-oauth-scopes' : Constants . OAUTH_SCOPES . RECOMMENDED ,
217+ } ,
208218 ) ;
209219 } ) ;
210220
@@ -218,6 +228,7 @@ describe('renderer/utils/auth/utils.ts', () => {
218228
219229 expect ( result . accounts ) . toEqual ( [
220230 {
231+ hasRequiredScopes : true ,
221232 hostname : 'github.gitify.io' as Hostname ,
222233 method : 'Personal Access Token' ,
223234 platform : 'GitHub Enterprise Server' ,
@@ -238,6 +249,7 @@ describe('renderer/utils/auth/utils.ts', () => {
238249
239250 expect ( result . accounts ) . toEqual ( [
240251 {
252+ hasRequiredScopes : true ,
241253 hostname : 'github.gitify.io' as Hostname ,
242254 method : 'OAuth App' ,
243255 platform : 'GitHub Enterprise Server' ,
0 commit comments