fix: Prevent AI assistant session reset when workflow is saved (#10707)

This commit is contained in:
Milorad FIlipović
2024-09-06 11:06:51 +02:00
committed by GitHub
parent 4efcbc5936
commit 91d9be2066
3 changed files with 32 additions and 2 deletions

View File

@@ -1,3 +1,4 @@
import { SCHEDULE_TRIGGER_NODE_NAME } from '../constants';
import { NDV, WorkflowPage } from '../pages';
import { AIAssistant } from '../pages/features/ai-assistant';
@@ -287,4 +288,18 @@ describe('AI Assistant::enabled', () => {
// Now, session should be reset
aiAssistant.getters.placeholderMessage().should('be.visible');
});
it('Should not reset assistant session when workflow is saved', () => {
cy.intercept('POST', '/rest/ai-assistant/chat', {
statusCode: 200,
fixture: 'aiAssistant/simple_message_response.json',
}).as('chatRequest');
wf.actions.addInitialNodeToCanvas(SCHEDULE_TRIGGER_NODE_NAME);
aiAssistant.actions.openChat();
aiAssistant.actions.sendMessage('Hello');
wf.actions.openNode(SCHEDULE_TRIGGER_NODE_NAME);
ndv.getters.nodeExecuteButton().click();
wf.getters.isWorkflowSaved();
aiAssistant.getters.placeholderMessage().should('not.exist');
});
});