Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rocket.Chat
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor 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
RocketChat
Rocket.Chat
Commits
91e7b082
Commit
91e7b082
authored
2 days ago
by
Lucas Pelegrino
Browse files
Options
Downloads
Patches
Plain Diff
test: improves audit.settings e2e tests
parent
b87a99ee
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
apps/meteor/tests/end-to-end/api/settings.ts
+16
-3
16 additions, 3 deletions
apps/meteor/tests/end-to-end/api/settings.ts
with
16 additions
and
3 deletions
apps/meteor/tests/end-to-end/api/settings.ts
+
16
−
3
View file @
91e7b082
import
type
{
LoginServiceConfiguration
}
from
'
@rocket.chat/core-typings
'
;
import
type
{
IServerEvents
,
LoginServiceConfiguration
}
from
'
@rocket.chat/core-typings
'
;
import
{
expect
}
from
'
chai
'
;
import
{
before
,
describe
,
it
,
after
}
from
'
mocha
'
;
...
...
@@ -275,6 +275,8 @@ describe('[Settings]', () => {
});
describe
(
'
/audit.settings
'
,
()
=>
{
const
formatDate
=
(
date
:
Date
)
=>
date
.
toISOString
().
slice
(
0
,
10
).
replace
(
/-/g
,
'
/
'
);
it
(
'
should return list of settings changed (no filters)
'
,
async
()
=>
{
void
request
.
get
(
api
(
'
audit.settings
'
))
...
...
@@ -288,9 +290,13 @@ describe('[Settings]', () => {
});
it
(
'
should return list of settings between date ranges
'
,
async
()
=>
{
const
startDate
=
new
Date
();
const
endDate
=
new
Date
();
endDate
.
setDate
(
startDate
.
getDate
()
+
1
);
void
request
.
get
(
api
(
'
audit.settings
'
))
.
query
({
start
:
'
2025/01/01
'
,
end
:
'
2025/01/31
'
})
.
query
({
start
:
formatDate
(
startDate
),
end
:
formatDate
(
endDate
)
})
.
set
(
credentials
)
.
expect
(
'
Content-Type
'
,
'
application/json
'
)
.
expect
(
200
)
...
...
@@ -323,13 +329,20 @@ describe('[Settings]', () => {
.
expect
((
res
)
=>
{
expect
(
res
.
body
).
to
.
have
.
property
(
'
success
'
,
true
);
expect
(
res
.
body
).
to
.
have
.
property
(
'
events
'
).
and
.
to
.
be
.
an
(
'
array
'
);
res
.
body
.
events
.
find
(
(
event
:
IServerEvents
[
'
settings.changed
'
])
=>
event
.
data
[
0
].
key
===
'
id
'
&&
event
.
data
[
0
].
value
===
'
Site_Url
'
,
);
});
});
it
(
'
should return list of changes of an specific setting filtered by an actor between date ranges
'
,
async
()
=>
{
const
startDate
=
new
Date
();
const
endDate
=
new
Date
();
endDate
.
setDate
(
startDate
.
getDate
()
+
1
);
void
request
.
get
(
api
(
'
audit.settings
'
))
.
query
({
actor
:
{
type
:
'
user
'
},
start
:
'
2025/01/01
'
,
end
:
'
2025/01/31
'
})
.
query
({
actor
:
{
type
:
'
user
'
},
start
:
formatDate
(
startDate
),
end
:
formatDate
(
endDate
)
})
.
set
(
credentials
)
.
expect
(
'
Content-Type
'
,
'
application/json
'
)
.
expect
(
200
)
...
...
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