Skip to content

Commit

Permalink
fix: fixed E2E tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Shivam Gupta authored and lordrip committed May 8, 2024
1 parent 511b25d commit d7ed89d
Showing 1 changed file with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ describe('Tests for Design page', () => {
cy.openDesignPage();
cy.removeNodeByName('setHeader');
cy.removeNodeByName('log');
cy.removeNodeByName('timer');
cy.checkNodeExist('from: Unknown', 1);
cy.removeNodeByName('marshal');
cy.checkNodeExist('timer', 1);

cy.openSourceCode();
cy.checkCodeSpanLine('uri: timer:test', 0);
cy.checkCodeSpanLine('uri: timer:test', 1);
cy.checkCodeSpanLine('marshal', 0);
cy.checkCodeSpanLine('setHeader', 0);
cy.checkCodeSpanLine('constant: test', 0);
cy.checkCodeSpanLine('name: test', 0);
Expand All @@ -36,21 +37,19 @@ describe('Tests for Design page', () => {
cy.checkCodeSpanLine('sink: {}', 1);
});

it('In an integration with at least two steps, user deletes the first step, showing a placeholder step in its place (start-end)', () => {
it('In an integration with at least two steps, user can not delete the from step', () => {
cy.uploadFixture('flows/camelRoute/basic.yaml');
cy.openDesignPage();

cy.removeNodeByName('timer');
cy.checkNodeExist('from: Unknown', 1);
cy.checkNodeExist('setHeader', 1);
cy.checkNodeExist('log', 1);
// CHECK that delete menu does not exist for the from node
cy.get(`[data-nodelabel="timer"]`).parent().eq(0).rightclick({ force: true });
cy.get(`[data-testid="context-menu-item-delete"]`).should('not.exist');

// CHECK that the step is deleted
cy.get('[data-id^="timer"]').should('not.exist');
cy.checkNodeExist('timer', 1);

cy.openSourceCode();
// CHECK that YAML not contains the 'timer:test'
cy.checkCodeSpanLine('timer:test', 0);
// CHECK that YAML contains the 'timer:test'
cy.checkCodeSpanLine('timer:test', 1);
});

it('Step detail - User deletes a step, which closes the detail drawer', () => {
Expand Down

0 comments on commit d7ed89d

Please sign in to comment.