Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 
 

58 wiersze
1.5 KiB

  1. context('MultiSelectDialog', () => {
  2. before(() => {
  3. cy.login();
  4. cy.visit('/app');
  5. });
  6. function open_multi_select_dialog() {
  7. cy.window().its('frappe').then(frappe => {
  8. new frappe.ui.form.MultiSelectDialog({
  9. doctype: "Assignment Rule",
  10. target: {},
  11. setters: {
  12. document_type: null,
  13. priority: null
  14. },
  15. add_filters_group: 1,
  16. allow_child_item_selection: 1,
  17. child_fieldname: "assignment_days",
  18. child_columns: ["day"]
  19. });
  20. });
  21. }
  22. it('multi select dialog api works', () => {
  23. open_multi_select_dialog();
  24. cy.get_open_dialog().should('contain', 'Select Assignment Rules');
  25. });
  26. it('checks for filters', () => {
  27. ['search_term', 'document_type', 'priority'].forEach(fieldname => {
  28. cy.get_open_dialog().get(`.frappe-control[data-fieldname="${fieldname}"]`).should('exist');
  29. });
  30. // add_filters_group: 1 should add a filter group
  31. cy.get_open_dialog().get(`.frappe-control[data-fieldname="filter_area"]`).should('exist');
  32. });
  33. it('checks for child item selection', () => {
  34. cy.get_open_dialog()
  35. .get(`.dt-row-header`).should('not.exist');
  36. cy.get_open_dialog()
  37. .get(`.frappe-control[data-fieldname="allow_child_item_selection"]`)
  38. .should('exist')
  39. .click();
  40. cy.get_open_dialog()
  41. .get(`.frappe-control[data-fieldname="child_selection_area"]`)
  42. .should('exist');
  43. cy.get_open_dialog()
  44. .get(`.dt-row-header`).should('contain', 'Assignment Rule');
  45. cy.get_open_dialog()
  46. .get(`.dt-row-header`).should('contain', 'Day');
  47. });
  48. });