FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
frontend/common/test/services/ShouldServeFrontTest.scala at master · devhttps/frontend · GitHub
devhttps
/
frontend
Public
forked from
guardian/frontend
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
frontend
/
common
/
test
/
services
/
ShouldServeFrontTest.scala
Copy path
More file actions
More file actions
Latest commit
History
History
History
95 lines (88 loc) · 2.93 KB
Breadcrumbs
frontend
/
common
/
test
/
services
/
ShouldServeFrontTest.scala
Copy path
File metadata and controls
95 lines (88 loc) · 2.93 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
package
services
import
com
.
gu
.
facia
.
client
.
models
.{
Branded
,
CollectionConfigJson
,
ConfigJson
,
FrontJson
}
import
model
.{
ApplicationContext
,
ApplicationIdentity
}
import
org
.
scalatest
.
concurrent
.
ScalaFutures
import
org
.
scalatest
.{
BeforeAndAfterAll
,
FlatSpec
,
Matchers
}
import
play
.
api
.
Environment
import
test
.
WithTestApplicationContext
import
scala
.
concurrent
.
duration
.
_
import
scala
.
concurrent
.
Await
class
ShouldServeFrontTest
extends
FlatSpec
with
Matchers
with
WithTestApplicationContext
with
ScalaFutures
with
BeforeAndAfterAll
{
val
fronts
=
ConfigJson
(
Map
(
"
editorial-front
"
->
FrontJson
(
collections
=
List
(
"
e59785e9-ba82-48d8-b79a-0a80b2f9f808
"
),
navSection
=
None
,
webTitle
=
None
,
title
=
None
,
description
=
None
,
onPageDescription
=
None
,
imageUrl
=
None
,
imageWidth
=
None
,
imageHeight
=
None
,
isImageDisplayed
=
None
,
priority
=
Some
(
"
editorial
"
),
isHidden
=
None
,
canonical
=
Some
(
"
e59785e9-ba82-48d8-b79a-0a80b2f9f808
"
),
group
=
Some
(
"
US professional
"
)
),
"
hidden-editorial-front
"
->
FrontJson
(
collections
=
List
(
"
e59785e9-ba82-48d8-b79a-0a80b2f9f808
"
),
navSection
=
None
,
webTitle
=
None
,
title
=
None
,
description
=
None
,
onPageDescription
=
None
,
imageUrl
=
None
,
imageWidth
=
None
,
imageHeight
=
None
,
isImageDisplayed
=
None
,
priority
=
Some
(
"
editorial
"
),
isHidden
=
Some
(
true
),
canonical
=
Some
(
"
e59785e9-ba82-48d8-b79a-0a80b2f9f808
"
),
group
=
Some
(
"
US professional
"
)
)
),
Map
(
"
e59785e9-ba82-48d8-b79a-0a80b2f9f808
"
->
CollectionConfigJson
(
displayName
=
Some
(
"
sc johnson partner zone
"
),
backfill
=
None
,
metadata
=
Some
(
List
(
Branded
)),
`type`
=
Some
(
"
fixed/large/slow-XIV
"
),
href
=
None
,
description
=
None
,
groups
=
None
,
uneditable
=
None
,
showTags
=
None
,
showSections
=
None
,
hideKickers
=
None
,
showDateHeader
=
None
,
showLatestUpdate
=
None
,
excludeFromRss
=
None
,
showTimestamps
=
None
,
hideShowMore
=
None
,
displayHints
=
None
,
platform
=
None
)
)
)
override
def
beforeAll
()
:
Unit
=
{
val
refresh
=
ConfigAgent
.refreshWith(fronts)
Await
.result(refresh,
3
.seconds)
}
"
shouldServeFront
"
should
"
not serve the front if the front is not in the config JSON
"
in {
ConfigAgent
.shouldServeFront(
"
nonexistent-front
"
) should be(
false
)
}
it should
"
not serve a hidden editorial front
"
in {
ConfigAgent
.shouldServeFront(
"
hidden-editorial-front
"
) should be(
false
)
}
it should
"
serve a hidden front in preview mode
"
in {
val
previewContext
=
ApplicationContext
(
Environment
.simple(),
ApplicationIdentity
(
"
preview
"
))
ConfigAgent
.shouldServeFront(
"
hidden-editorial-front
"
)(previewContext) should be(
true
)
}
}
Back
|
FazBrowse Home
|
New Git URL