@@ -10,13 +10,11 @@ import type { ShortUrlsOrder } from '../../src/short-urls/data';
10
10
import type { ShortUrlsList as ShortUrlsListModel } from '../../src/short-urls/reducers/shortUrlsList' ;
11
11
import { ShortUrlsListFactory } from '../../src/short-urls/ShortUrlsList' ;
12
12
import type { ShortUrlsTableType } from '../../src/short-urls/ShortUrlsTable' ;
13
- import { FeaturesProvider } from '../../src/utils/features' ;
14
13
import { checkAccessibility } from '../__helpers__/accessibility' ;
15
14
import { renderWithEvents } from '../__helpers__/setUpTest' ;
16
15
17
16
type SetUpOptions = {
18
17
settings ?: Partial < Settings > ;
19
- excludeBotsOnShortUrls ?: boolean ;
20
18
loading ?: boolean ;
21
19
} ;
22
20
@@ -43,20 +41,18 @@ describe('<ShortUrlsList />', () => {
43
41
} ) ;
44
42
let history : MemoryHistory ;
45
43
const ShortUrlsList = ShortUrlsListFactory ( fromPartial ( { ShortUrlsTable, ShortUrlsFilteringBar } ) ) ;
46
- const setUp = ( { settings = { } , excludeBotsOnShortUrls = true , loading = false } : SetUpOptions = { } ) => {
44
+ const setUp = ( { settings = { } , loading = false } : SetUpOptions = { } ) => {
47
45
history = createMemoryHistory ( ) ;
48
46
history . push ( { search : '?tags=test%20tag&search=example.com' } ) ;
49
47
50
48
return renderWithEvents (
51
49
< Router location = { history . location } navigator = { history } >
52
50
< SettingsProvider value = { fromPartial ( settings ) } >
53
- < FeaturesProvider value = { fromPartial ( { excludeBotsOnShortUrls } ) } >
54
- < ShortUrlsList
55
- { ...fromPartial < MercureBoundProps > ( { mercureInfo : { loading : true } } ) }
56
- listShortUrls = { listShortUrlsMock }
57
- shortUrlsList = { { ...shortUrlsList , loading } }
58
- />
59
- </ FeaturesProvider >
51
+ < ShortUrlsList
52
+ { ...fromPartial < MercureBoundProps > ( { mercureInfo : { loading : true } } ) }
53
+ listShortUrls = { listShortUrlsMock }
54
+ shortUrlsList = { { ...shortUrlsList , loading } }
55
+ />
60
56
</ SettingsProvider >
61
57
</ Router > ,
62
58
) ;
@@ -119,26 +115,15 @@ describe('<ShortUrlsList />', () => {
119
115
shortUrlsList : {
120
116
defaultOrdering : { field : 'visits' , dir : 'ASC' } ,
121
117
} ,
122
- } ) , false , { field : 'visits' , dir : 'ASC' } ] ,
118
+ } ) , { field : 'visits' , dir : 'ASC' } ] ,
123
119
[ fromPartial < Settings > ( {
124
120
shortUrlsList : {
125
121
defaultOrdering : { field : 'visits' , dir : 'ASC' } ,
126
122
} ,
127
123
visits : { excludeBots : true } ,
128
- } ) , false , { field : 'visits' , dir : 'ASC' } ] ,
129
- [ fromPartial < Settings > ( {
130
- shortUrlsList : {
131
- defaultOrdering : { field : 'visits' , dir : 'ASC' } ,
132
- } ,
133
- } ) , true , { field : 'visits' , dir : 'ASC' } ] ,
134
- [ fromPartial < Settings > ( {
135
- shortUrlsList : {
136
- defaultOrdering : { field : 'visits' , dir : 'ASC' } ,
137
- } ,
138
- visits : { excludeBots : true } ,
139
- } ) , true , { field : 'nonBotVisits' , dir : 'ASC' } ] ,
140
- ] ) ( 'parses order by based on supported features version and config' , ( settings , excludeBotsOnShortUrls , expectedOrderBy ) => {
141
- setUp ( { settings, excludeBotsOnShortUrls } ) ;
124
+ } ) , { field : 'nonBotVisits' , dir : 'ASC' } ] ,
125
+ ] ) ( 'parses order by based on supported features version and config' , ( settings , expectedOrderBy ) => {
126
+ setUp ( { settings } ) ;
142
127
expect ( listShortUrlsMock ) . toHaveBeenCalledWith ( expect . objectContaining ( { orderBy : expectedOrderBy } ) ) ;
143
128
} ) ;
144
129
} ) ;
0 commit comments