Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix errors with validation templates when no approver set #19194

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

cconard96
Copy link
Contributor

@cconard96 cconard96 commented Mar 13, 2025

Checklist before requesting a review

  • I have read the CONTRIBUTING document.
  • I have performed a self-review of my code.

Description

Fixes #19170

@cconard96 cconard96 marked this pull request as draft March 13, 2025 12:43
@cconard96 cconard96 changed the title Fix error showing validation template approver field when none selected Fix errors with validation templates when no approver set Mar 13, 2025
@cconard96 cconard96 force-pushed the fix/validation_template_noapprover branch from d03d101 to 088290a Compare March 13, 2025 14:02
@cconard96 cconard96 marked this pull request as ready for review March 14, 2025 17:20
Comment on lines +136 to +153
cy.get('.timeline-buttons .main-actions button.dropdown-toggle-split').click();
cy.findByText('Ask for validation').click();
cy.get('.itilvalidation').within(() => {
cy.getDropdownByLabelText('Template').selectDropdownValue(`test ${rand}`);
cy.get('select[name="[validatortype]"]').should('have.value', 'User');
cy.get('select[name="items_id_target"]').should('have.value', '2');
cy.get('textarea[name="comment_submission"]').awaitTinyMCE().should('contain.text', 'test content');
});
cy.visit(`/front/ticket.form.php?id=${ticket_id}`);
cy.get('.timeline-buttons .main-actions button.dropdown-toggle-split').click();
cy.findByText('Ask for validation').click();
cy.get('.itilvalidation').within(() => {
cy.getDropdownByLabelText('Template').selectDropdownValue(`test no approver ${rand}`);
cy.get('select[name="[validatortype]"]').should('have.value', '0');
cy.get('select[name="items_id_target"]').should('not.exist');
cy.get('textarea[name="comment_submission"]').awaitTinyMCE().should('contain.text', 'no approver test content');
});
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use stronger selectors (accessibility based or with tests ids).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validation templates don't fill the form
3 participants