1
1
import 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' ;
7
3
8
4
import {
9
5
ChevronDownIcon ,
@@ -19,6 +15,7 @@ import {
19
15
mockSingleNotification ,
20
16
} from './api/__mocks__/response-mocks' ;
21
17
import * as apiRequests from './api/request' ;
18
+
22
19
import {
23
20
formatForDisplay ,
24
21
formatNotificationUpdatedAt ,
@@ -27,9 +24,7 @@ import {
27
24
getChevronDetails ,
28
25
getFilterCount ,
29
26
getPlatformFromHostname ,
30
- isAnsweredDiscussionFeatureSupported ,
31
27
isEnterpriseServerHost ,
32
- isMarkAsDoneFeatureSupported ,
33
28
} from './helpers' ;
34
29
35
30
describe ( 'renderer/utils/helpers.ts' , ( ) => {
@@ -69,92 +64,6 @@ describe('renderer/utils/helpers.ts', () => {
69
64
} ) ;
70
65
} ) ;
71
66
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
-
158
67
describe ( 'generateNotificationReferrerId' , ( ) => {
159
68
it ( 'should generate the notification_referrer_id' , ( ) => {
160
69
const referrerId = generateNotificationReferrerId ( mockSingleNotification ) ;
0 commit comments