Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F7687805
sanity_checks.spec.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
996 B
Referenced Files
None
Subscribers
None
sanity_checks.spec.js
View Options
import
{
getColors
}
from
'src/services/theme_data/theme_data.service.js'
const
checkColors
=
(
output
)
=>
{
expect
(
output
).
to
.
have
.
property
(
'colors'
)
Object
.
entries
(
output
.
colors
).
forEach
(([
key
,
v
])
=>
{
expect
(
v
,
key
).
to
.
be
.
an
(
'object'
)
expect
(
v
,
key
).
to
.
include
.
all
.
keys
(
'r'
,
'g'
,
'b'
)
'rgba'
.
split
(
''
).
forEach
(
k
=>
{
if
((
k
===
'a'
&&
v
.
hasOwnProperty
(
'a'
))
||
k
!==
'a'
)
{
expect
(
v
[
k
],
key
+
'.'
+
k
).
to
.
be
.
a
(
'number'
)
expect
(
v
[
k
],
key
+
'.'
+
k
).
to
.
be
.
least
(
0
)
expect
(
v
[
k
],
key
+
'.'
+
k
).
to
.
be
.
most
(
k
===
'a'
?
1
:
255
)
}
})
})
}
describe
(
'Theme Data utility functions'
,
()
=>
{
const
context
=
require
.
context
(
'static/themes/'
,
false
,
/\.json$/
)
context
.
keys
().
forEach
((
key
)
=>
{
it
(
`Should render all colors for
${
key
}
properly`
,
()
=>
{
const
{
theme
,
source
}
=
context
(
key
)
const
data
=
source
||
theme
const
colors
=
getColors
(
data
.
colors
,
data
.
opacity
,
1
)
checkColors
(
colors
)
})
})
})
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Sep 3, 11:45 PM (1 d, 19 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
439387
Default Alt Text
sanity_checks.spec.js (996 B)
Attached To
Mode
rPUFE pleroma-fe-upstream
Attached
Detach File
Event Timeline
Log In to Comment