Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
admin-fe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pleroma
admin-fe
Commits
cc6c8b2b
Commit
cc6c8b2b
authored
4 years ago
by
Angelina Filippova
Browse files
Options
Downloads
Patches
Plain Diff
Add tests for function that checks if setting follows rules
parent
2aede0f1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!190
Ability to set rules and conditions for rendering settings
Pipeline
#33825
passed
4 years ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/views/settings/settingFollowsRules.test.js
+35
-0
35 additions, 0 deletions
test/views/settings/settingFollowsRules.test.js
with
35 additions
and
0 deletions
test/views/settings/settingFollowsRules.test.js
0 → 100644
+
35
−
0
View file @
cc6c8b2b
import
{
settingFollowsRules
}
from
'
@/views/settings/rules
'
describe
(
'
Check if settings follow rules
'
,
()
=>
{
it
(
'
does not render :proxy_remote when local :uploader is selected
'
,
()
=>
{
const
state
=
{
'
:pleroma
'
:
{
'
Pleroma.Upload
'
:
{
'
:uploader
'
:
'
Pleroma.Uploaders.Local
'
}}}
expect
(
settingFollowsRules
(
'
:proxy_remote
'
,
'
Pleroma.Upload
'
,
state
)).
toBeFalsy
()
})
it
(
'
render :proxy_remote when local :uploader is not selected
'
,
()
=>
{
const
state
=
{
'
:pleroma
'
:
{
'
Pleroma.Upload
'
:
{
'
:uploader
'
:
'
Pleroma.Uploaders.S3
'
}}}
expect
(
settingFollowsRules
(
'
:proxy_remote
'
,
'
Pleroma.Upload
'
,
state
)).
toBeTruthy
()
})
it
(
'
render setting when there is no rule
'
,
()
=>
{
const
state
=
{
'
:pleroma
'
:
{
'
Pleroma.Upload
'
:
{
'
:uploader
'
:
'
Pleroma.Uploaders.Local
'
}}}
expect
(
settingFollowsRules
(
'
:filters
'
,
'
Pleroma.Upload
'
,
state
)).
toBeTruthy
()
})
it
(
'
render setting when one of the keys is undefined
'
,
()
=>
{
const
state
=
{
'
:pleroma
'
:
{}}
expect
(
settingFollowsRules
(
'
:level
'
,
undefined
,
state
)).
toBeTruthy
()
expect
(
settingFollowsRules
(
'
:admin_token
'
,
undefined
,
state
)).
toBeTruthy
()
})
it
(
'
render setting when state is empty
'
,
()
=>
{
const
state
=
{
'
:pleroma
'
:
{
'
Pleroma.Upload
'
:
{}}}
expect
(
settingFollowsRules
(
'
:proxy_remote
'
,
'
Pleroma.Upload
'
,
state
)).
toBeTruthy
()
})
})
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment