mirror of
https://github.com/open-webui/open-webui
synced 2024-11-22 08:07:55 +00:00
tests: update share test to actually share
This commit is contained in:
parent
c70b18b2ef
commit
153ba168a0
@ -64,16 +64,18 @@ describe('Settings', () => {
|
|||||||
cy.get('div[aria-label="Generation Info"]', { timeout: 120_000 }).should('exist');
|
cy.get('div[aria-label="Generation Info"]', { timeout: 120_000 }).should('exist');
|
||||||
// spy on requests
|
// spy on requests
|
||||||
const spy = cy.spy();
|
const spy = cy.spy();
|
||||||
cy.intercept('GET', '/api/v1/chats/*', spy);
|
cy.intercept('POST', '/api/v1/chats/**/share', spy);
|
||||||
// Open context menu
|
// Open context menu
|
||||||
cy.get('#chat-context-menu-button').click();
|
cy.get('#chat-context-menu-button').click();
|
||||||
// Click share button
|
// Click share button
|
||||||
cy.get('#chat-share-button').click();
|
cy.get('#chat-share-button').click();
|
||||||
// Check if the share dialog is visible
|
// Check if the share dialog is visible
|
||||||
cy.get('#copy-and-share-chat-button').should('exist');
|
cy.get('#copy-and-share-chat-button').should('exist');
|
||||||
cy.wrap({}, { timeout: 5000 }).should(() => {
|
// Click the copy button
|
||||||
// Check if the request was made twice (once for to replace chat object and once more due to change event)
|
cy.get('#copy-and-share-chat-button').click();
|
||||||
expect(spy).to.be.callCount(2);
|
cy.wrap({}, { timeout: 5_000 }).should(() => {
|
||||||
|
// Check if the share request was made
|
||||||
|
expect(spy).to.be.callCount(1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user