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
9eb5a1b3
Commit
9eb5a1b3
authored
4 years ago
by
Angelina Filippova
Browse files
Options
Downloads
Patches
Plain Diff
Mock fetching and updating settings for users tests
parent
58ba64b8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/api/__mocks__/settings.js
+29
-0
29 additions, 0 deletions
src/api/__mocks__/settings.js
test/views/users/index.test.js
+1
-0
1 addition, 0 deletions
test/views/users/index.test.js
with
30 additions
and
0 deletions
src/api/__mocks__/settings.js
0 → 100644
+
29
−
0
View file @
9eb5a1b3
const
configsWithoutTagPolicy
=
{
configs
:
[{
group
:
'
:pleroma
'
,
key
:
'
:mrf
'
,
value
:
[
{
tuple
:
[
'
:policies
'
,
'
Pleroma.Web.ActivityPub.MRF.ObjectAgePolicy
'
]
},
{
tuple
:
[
'
:transparency
'
,
true
]
},
{
tuple
:
[
'
:transparency_exclusions
'
,
[]]
}
]
}],
need_reboot
:
false
}
const
configAfterUpdate
=
{
configs
:
[{
db
:
[
'
:policies
'
],
group
:
'
:pleroma
'
,
key
:
'
:mrf
'
,
value
:
[{
tuple
:
[
'
:policies
'
,
[
'
Pleroma.Web.ActivityPub.MRF.ObjectAgePolicy
'
,
'
Pleroma.Web.ActivityPub.MRF.TagPolicy
'
]]
}]
}],
need_reboot
:
false
}
export
async
function
fetchSettings
(
authHost
,
token
)
{
return
Promise
.
resolve
({
data
:
configsWithoutTagPolicy
})
}
export
async
function
updateSettings
(
configs
,
authHost
,
token
)
{
return
Promise
.
resolve
({
data
:
configAfterUpdate
})
}
This diff is collapsed.
Click to expand it.
test/views/users/index.test.js
+
1
−
0
View file @
9eb5a1b3
...
...
@@ -17,6 +17,7 @@ localVue.use(Element)
jest
.
mock
(
'
@/api/app
'
)
jest
.
mock
(
'
@/api/nodeInfo
'
)
jest
.
mock
(
'
@/api/users
'
)
jest
.
mock
(
'
@/api/settings
'
)
describe
(
'
Search and filter users
'
,
()
=>
{
let
store
...
...
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