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
044cfbc2
Commit
044cfbc2
authored
5 years ago
by
Angelina Filippova
Browse files
Options
Downloads
Patches
Plain Diff
Test if tab changes after setting was selected
parent
0e972e44
No related branches found
No related tags found
2 merge requests
!125
WIP: Release/2.0.3
,
!102
Implement settings search
Pipeline
#23849
failed
5 years ago
Stage: build
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/views/settings/formSearchObject.test.js
+1
-1
1 addition, 1 deletion
test/views/settings/formSearchObject.test.js
test/views/settings/index.test.js
+14
-14
14 additions, 14 deletions
test/views/settings/index.test.js
with
15 additions
and
15 deletions
test/views/settings/formSearchObject.test.js
+
1
−
1
View file @
044cfbc2
...
...
@@ -86,7 +86,7 @@ describe('Form search object', () => {
expect
(
_
.
isEqual
(
formSearchObject
(
description
),
expected
)).
toBeTruthy
()
})
it
(
'
forms search object for setting without key
'
,
()
=>
{
it
(
'
forms search object for setting without key
and description
'
,
()
=>
{
const
description
=
[{
group
:
"
:cors_plug
"
,
label
:
"
Cors plug
"
,
...
...
This diff is collapsed.
Click to expand it.
test/views/settings/index.test.js
+
14
−
14
View file @
044cfbc2
...
...
@@ -4,10 +4,7 @@ import Element from 'element-ui'
import
Settings
from
'
@/views/settings/index
'
import
flushPromises
from
'
flush-promises
'
import
app
from
'
@/store/modules/app
'
import
relays
from
'
@/store/modules/relays
'
import
settings
from
'
@/store/modules/settings
'
import
user
from
'
@/store/modules/user
'
import
users
from
'
@/store/modules/users
'
import
getters
from
'
@/store/getters
'
config
.
mocks
[
"
$t
"
]
=
()
=>
{}
...
...
@@ -19,18 +16,13 @@ localVue.use(Element)
describe
(
'
Settings search
'
,
()
=>
{
let
store
let
actions
let
permission
beforeEach
(()
=>
{
actions
=
{
SetActiveTab
:
jest
.
fn
()
}
permission
=
{
addRouters
:
jest
.
fn
()
}
actions
=
{
...
settings
.
actions
,
FetchSettings
:
jest
.
fn
()
}
store
=
new
Vuex
.
Store
({
modules
:
{
app
,
permission
,
relays
,
settings
:
{
...
settings
,
actions
},
user
,
settings
:
{
...
settings
,
actions
}
},
getters
})
...
...
@@ -47,17 +39,25 @@ describe('Settings search', () => {
expect
(
searchInput
.
exists
()).
toBe
(
true
)
done
()
})
it
(
'
changes tab when search value was selected
'
,
async
(
done
)
=>
{
const
wrapper
=
mount
(
Settings
,
{
store
,
localVue
})
await
flushPromises
()
wrapper
.
vm
.
handleSearchSelect
({
group
:
'
Pleroma.Upload
'
,
key
:
'
Pleroma.Upload
'
})
expect
(
actions
.
SetActiveTab
).
toHaveBeenCalled
()
expect
(
actions
.
SetActiveTab
).
toHaveBeenCalledWith
(
expect
.
anything
(),
'
upload
'
,
undefined
)
expect
(
store
.
state
.
settings
.
activeTab
).
toBe
(
'
upload
'
)
wrapper
.
vm
.
handleSearchSelect
({
group
:
'
:swoosh
'
,
key
:
'
:serve_mailbox
'
})
expect
(
store
.
state
.
settings
.
activeTab
).
toBe
(
'
mailer
'
)
wrapper
.
vm
.
handleSearchSelect
({
group
:
'
:pleroma
'
,
key
:
'
:admin_token
'
})
expect
(
store
.
state
.
settings
.
activeTab
).
toBe
(
'
instance
'
)
wrapper
.
vm
.
handleSearchSelect
({
group
:
'
:media_proxy
'
,
key
:
'
:ssl_options
'
})
expect
(
store
.
state
.
settings
.
activeTab
).
toBe
(
'
media-proxy
'
)
wrapper
.
vm
.
handleSearchSelect
({
group
:
'
:opts
'
,
key
:
'
:opts
'
})
expect
(
store
.
state
.
settings
.
activeTab
).
toBe
(
'
auto-linker
'
)
done
()
})
})
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