Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
153ba168
Commit
153ba168
authored
Aug 11, 2024
by
Jun Siang Cheah
Browse files
tests: update share test to actually share
parent
c70b18b2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
cypress/e2e/chat.cy.ts
cypress/e2e/chat.cy.ts
+6
-4
No files found.
cypress/e2e/chat.cy.ts
View file @
153ba168
...
...
@@ -64,16 +64,18 @@ describe('Settings', () => {
cy
.
get
(
'
div[aria-label="Generation Info"]
'
,
{
timeout
:
120
_000
}).
should
(
'
exist
'
);
// spy on requests
const
spy
=
cy
.
spy
();
cy
.
intercept
(
'
GE
T
'
,
'
/api/v1/chats/*
'
,
spy
);
cy
.
intercept
(
'
POS
T
'
,
'
/api/v1/chats/*
*/share
'
,
spy
);
// Open context menu
cy
.
get
(
'
#chat-context-menu-button
'
).
click
();
// Click share button
cy
.
get
(
'
#chat-share-button
'
).
click
();
// Check if the share dialog is visible
cy
.
get
(
'
#copy-and-share-chat-button
'
).
should
(
'
exist
'
);
cy
.
wrap
({},
{
timeout
:
5000
}).
should
(()
=>
{
// Check if the request was made twice (once for to replace chat object and once more due to change event)
expect
(
spy
).
to
.
be
.
callCount
(
2
);
// Click the copy button
cy
.
get
(
'
#copy-and-share-chat-button
'
).
click
();
cy
.
wrap
({},
{
timeout
:
5
_000
}).
should
(()
=>
{
// Check if the share request was made
expect
(
spy
).
to
.
be
.
callCount
(
1
);
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment