@@ -14,13 +14,16 @@ class SearchParamsSpec extends AnyFlatSpec with models {
1414
1515 behavior of " build"
1616
17- it should " return empty search params when none are set with default supplier exclusion set" in new searchParamsMocks {
17+ it should " return empty search params when none are set with default supplier and source feed exclusions set" in new searchParamsMocks {
1818 SearchParams .build(
1919 emptyQueryString,
2020 emptyBaseParams,
2121 featureSwitchesOn
2222 )(FakeRequest ()) shouldEqual emptySearchParams.copy(filters =
23- emptyFilterParams.copy(suppliersExcl = List (" UNAUTHED_EMAIL_FEED" ))
23+ emptyFilterParams.copy(
24+ suppliersExcl = List (" UNAUTHED_EMAIL_FEED" ),
25+ guSourceFeedsExcl = SearchParams .legacyPaSourceFeeds
26+ )
2427 )
2528 }
2629 it should " set an english search term when maybeFreeTextQuery is set" in new searchParamsMocks {
@@ -59,7 +62,9 @@ class SearchParamsSpec extends AnyFlatSpec with models {
5962 maybeEnd = Some (" end" ),
6063 maybeBeforeTimeStamp = Some (" 2023-01-01T00:00:00Z" ),
6164 maybeAfterTimeStamp = Some (" 2023-01-02T00:00:00Z" ),
62- hasDataFormatting = Some (true )
65+ hasDataFormatting = Some (true ),
66+ guSourceFeeds = List (" A" ),
67+ guSourceFeedsExcl = List (" B" )
6368 )
6469 val result = SearchParams .build(
6570 emptyQueryString,
@@ -84,8 +89,8 @@ class SearchParamsSpec extends AnyFlatSpec with models {
8489 collectionId = Some (1 ),
8590 preComputedCategories = Nil ,
8691 preComputedCategoriesExcl = Nil ,
87- guSourceFeeds = Nil ,
88- guSourceFeedsExcl = Nil
92+ guSourceFeeds = List ( " A " ) ,
93+ guSourceFeedsExcl = List ( " B " )
8994 ),
9095 DateRange (
9196 start = Some (" start" ),
@@ -108,6 +113,16 @@ class SearchParamsSpec extends AnyFlatSpec with models {
108113 )
109114 }
110115
116+ it should " include new PA API feed exclusions when the showPAAPI feature switch is off " in new searchParamsMocks {
117+ val result =
118+ SearchParams .build(
119+ emptyQueryString,
120+ emptyBaseParams,
121+ showPAAPIFeatureOff
122+ )(FakeRequest ())
123+ result.filters.guSourceFeedsExcl shouldEqual SearchParams .newPaSourceFeeds
124+ }
125+
111126 behavior of " computeSupplierExcl"
112127
113128 it should " return dotcopy exclusion when no additional exclusion params are set and showGuSuppliers is true" in new searchParamsMocks {
@@ -188,7 +203,7 @@ class SearchParamsSpec extends AnyFlatSpec with models {
188203 guSourceFeeds = Nil ,
189204 guSourceFeedsExcl = Nil
190205 )
191- result shouldEqual Nil
206+ result shouldEqual SearchParams .legacyPaSourceFeeds
192207 }
193208 it should " be possible to override PA_API exclusions with guSourceFeedExcl param" in new searchParamsMocks {
194209 val result = SearchParams .computeGuSourceFeedExcl(
0 commit comments