11import type { AxiosPromise , AxiosResponse } from 'axios' ;
2- import {
3- mockGitHubCloudAccount ,
4- mockGitHubEnterpriseServerAccount ,
5- mockPersonalAccessTokenAccount ,
6- } from '../__mocks__/state-mocks' ;
2+ import { mockPersonalAccessTokenAccount } from '../__mocks__/state-mocks' ;
73
84import {
95 ChevronDownIcon ,
@@ -19,6 +15,7 @@ import {
1915 mockSingleNotification ,
2016} from './api/__mocks__/response-mocks' ;
2117import * as apiRequests from './api/request' ;
18+
2219import {
2320 formatForDisplay ,
2421 formatNotificationUpdatedAt ,
@@ -27,9 +24,7 @@ import {
2724 getChevronDetails ,
2825 getFilterCount ,
2926 getPlatformFromHostname ,
30- isAnsweredDiscussionFeatureSupported ,
3127 isEnterpriseServerHost ,
32- isMarkAsDoneFeatureSupported ,
3328} from './helpers' ;
3429
3530describe ( 'renderer/utils/helpers.ts' , ( ) => {
@@ -69,92 +64,6 @@ describe('renderer/utils/helpers.ts', () => {
6964 } ) ;
7065 } ) ;
7166
72- describe ( 'isMarkAsDoneFeatureSupported' , ( ) => {
73- it ( 'should return true for GitHub Cloud' , ( ) => {
74- expect ( isMarkAsDoneFeatureSupported ( mockGitHubCloudAccount ) ) . toBe ( true ) ;
75- } ) ;
76-
77- it ( 'should return false for GitHub Enterprise Server < v3.13' , ( ) => {
78- const account = {
79- ...mockGitHubEnterpriseServerAccount ,
80- version : '3.12.0' ,
81- } ;
82-
83- expect ( isMarkAsDoneFeatureSupported ( account ) ) . toBe ( false ) ;
84- } ) ;
85-
86- it ( 'should return true for GitHub Enterprise Server >= v3.13' , ( ) => {
87- const account = {
88- ...mockGitHubEnterpriseServerAccount ,
89- version : '3.13.3' ,
90- } ;
91-
92- expect ( isMarkAsDoneFeatureSupported ( account ) ) . toBe ( true ) ;
93- } ) ;
94-
95- it ( 'should return false for GitHub Enterprise Server when partial version available' , ( ) => {
96- const account = {
97- ...mockGitHubEnterpriseServerAccount ,
98- version : '3' ,
99- } ;
100-
101- expect ( isMarkAsDoneFeatureSupported ( account ) ) . toBe ( false ) ;
102- } ) ;
103-
104- it ( 'should return false for GitHub Enterprise Server when no version available' , ( ) => {
105- const account = {
106- ...mockGitHubEnterpriseServerAccount ,
107- version : null ,
108- } ;
109-
110- expect ( isMarkAsDoneFeatureSupported ( account ) ) . toBe ( false ) ;
111- } ) ;
112- } ) ;
113-
114- describe ( 'isAnsweredDiscussionFeatureSupported' , ( ) => {
115- it ( 'should return true for GitHub Cloud' , ( ) => {
116- expect ( isAnsweredDiscussionFeatureSupported ( mockGitHubCloudAccount ) ) . toBe (
117- true ,
118- ) ;
119- } ) ;
120-
121- it ( 'should return false for GitHub Enterprise Server < v3.12' , ( ) => {
122- const account = {
123- ...mockGitHubEnterpriseServerAccount ,
124- version : '3.11.0' ,
125- } ;
126-
127- expect ( isAnsweredDiscussionFeatureSupported ( account ) ) . toBe ( false ) ;
128- } ) ;
129-
130- it ( 'should return true for GitHub Enterprise Server >= v3.12' , ( ) => {
131- const account = {
132- ...mockGitHubEnterpriseServerAccount ,
133- version : '3.12.3' ,
134- } ;
135-
136- expect ( isAnsweredDiscussionFeatureSupported ( account ) ) . toBe ( true ) ;
137- } ) ;
138-
139- it ( 'should return false for GitHub Enterprise Server when partial version available' , ( ) => {
140- const account = {
141- ...mockGitHubEnterpriseServerAccount ,
142- version : '3' ,
143- } ;
144-
145- expect ( isAnsweredDiscussionFeatureSupported ( account ) ) . toBe ( false ) ;
146- } ) ;
147-
148- it ( 'should return false for GitHub Enterprise Server when no version available' , ( ) => {
149- const account = {
150- ...mockGitHubEnterpriseServerAccount ,
151- version : null ,
152- } ;
153-
154- expect ( isMarkAsDoneFeatureSupported ( account ) ) . toBe ( false ) ;
155- } ) ;
156- } ) ;
157-
15867 describe ( 'generateNotificationReferrerId' , ( ) => {
15968 it ( 'should generate the notification_referrer_id' , ( ) => {
16069 const referrerId = generateNotificationReferrerId ( mockSingleNotification ) ;
0 commit comments