88 filterDetailedNotifications ,
99 hasAnyFiltersSet ,
1010} from './filter' ;
11- import { AUTHOR_PREFIX , ORG_PREFIX , REPO_PREFIX } from './search' ;
1211
1312describe ( 'renderer/utils/notifications/filters/filter.ts' , ( ) => {
1413 afterEach ( ( ) => {
@@ -83,7 +82,7 @@ describe('renderer/utils/notifications/filters/filter.ts', () => {
8382 it ( 'should filter notifications that match include organization' , async ( ) => {
8483 const result = filterBaseNotifications ( mockNotifications , {
8584 ...mockSettings ,
86- filterIncludeSearchTokens : [ ` ${ ORG_PREFIX } gitify-app` as SearchToken ] ,
85+ filterIncludeSearchTokens : [ 'org: gitify-app' as SearchToken ] ,
8786 } ) ;
8887
8988 expect ( result . length ) . toBe ( 1 ) ;
@@ -93,7 +92,7 @@ describe('renderer/utils/notifications/filters/filter.ts', () => {
9392 it ( 'should filter notifications that match exclude organization' , async ( ) => {
9493 const result = filterBaseNotifications ( mockNotifications , {
9594 ...mockSettings ,
96- filterExcludeSearchTokens : [ ` ${ ORG_PREFIX } github` as SearchToken ] ,
95+ filterExcludeSearchTokens : [ 'org: github' as SearchToken ] ,
9796 } ) ;
9897
9998 expect ( result . length ) . toBe ( 1 ) ;
@@ -103,9 +102,7 @@ describe('renderer/utils/notifications/filters/filter.ts', () => {
103102 it ( 'should filter notifications that match include repository' , async ( ) => {
104103 const result = filterBaseNotifications ( mockNotifications , {
105104 ...mockSettings ,
106- filterIncludeSearchTokens : [
107- `${ REPO_PREFIX } gitify-app/gitify` as SearchToken ,
108- ] ,
105+ filterIncludeSearchTokens : [ 'repo:gitify-app/gitify' as SearchToken ] ,
109106 } ) ;
110107
111108 expect ( result . length ) . toBe ( 1 ) ;
@@ -115,9 +112,7 @@ describe('renderer/utils/notifications/filters/filter.ts', () => {
115112 it ( 'should filter notifications that match exclude repository' , async ( ) => {
116113 const result = filterBaseNotifications ( mockNotifications , {
117114 ...mockSettings ,
118- filterExcludeSearchTokens : [
119- `${ REPO_PREFIX } github/github` as SearchToken ,
120- ] ,
115+ filterExcludeSearchTokens : [ 'repo:github/github' as SearchToken ] ,
121116 } ) ;
122117
123118 expect ( result . length ) . toBe ( 1 ) ;
@@ -131,12 +126,8 @@ describe('renderer/utils/notifications/filters/filter.ts', () => {
131126 ...mockSettings ,
132127 detailedNotifications : false ,
133128 filterUserTypes : [ 'Bot' ] ,
134- filterIncludeSearchTokens : [
135- `${ AUTHOR_PREFIX } github-user` as SearchToken ,
136- ] ,
137- filterExcludeSearchTokens : [
138- `${ AUTHOR_PREFIX } github-bot` as SearchToken ,
139- ] ,
129+ filterIncludeSearchTokens : [ 'author:github-user' as SearchToken ] ,
130+ filterExcludeSearchTokens : [ 'author:github-bot' as SearchToken ] ,
140131 filterStates : [ 'merged' ] ,
141132 } ) ;
142133
@@ -159,9 +150,7 @@ describe('renderer/utils/notifications/filters/filter.ts', () => {
159150 const result = filterDetailedNotifications ( mockNotifications , {
160151 ...mockSettings ,
161152 detailedNotifications : true ,
162- filterIncludeSearchTokens : [
163- `${ AUTHOR_PREFIX } github-user` as SearchToken ,
164- ] ,
153+ filterIncludeSearchTokens : [ 'author:github-user' as SearchToken ] ,
165154 } ) ;
166155
167156 expect ( result . length ) . toBe ( 1 ) ;
@@ -172,9 +161,7 @@ describe('renderer/utils/notifications/filters/filter.ts', () => {
172161 const result = filterDetailedNotifications ( mockNotifications , {
173162 ...mockSettings ,
174163 detailedNotifications : true ,
175- filterExcludeSearchTokens : [
176- `${ AUTHOR_PREFIX } github-bot` as SearchToken ,
177- ] ,
164+ filterExcludeSearchTokens : [ 'author:github-bot' as SearchToken ] ,
178165 } ) ;
179166
180167 expect ( result . length ) . toBe ( 1 ) ;
@@ -203,15 +190,15 @@ describe('renderer/utils/notifications/filters/filter.ts', () => {
203190 it ( 'non-default search token includes filters' , ( ) => {
204191 const settings : SettingsState = {
205192 ...defaultSettings ,
206- filterIncludeSearchTokens : [ ` ${ AUTHOR_PREFIX } gitify` as SearchToken ] ,
193+ filterIncludeSearchTokens : [ 'author: gitify' as SearchToken ] ,
207194 } ;
208195 expect ( hasAnyFiltersSet ( settings ) ) . toBe ( true ) ;
209196 } ) ;
210197
211198 it ( 'non-default search token excludes filters' , ( ) => {
212199 const settings : SettingsState = {
213200 ...defaultSettings ,
214- filterExcludeSearchTokens : [ ` ${ ORG_PREFIX } github` as SearchToken ] ,
201+ filterExcludeSearchTokens : [ 'org: github' as SearchToken ] ,
215202 } ;
216203 expect ( hasAnyFiltersSet ( settings ) ) . toBe ( true ) ;
217204 } ) ;
0 commit comments