Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 
 
 

44 řádky
1.2 KiB

  1. import custom_submittable_doctype from '../fixtures/custom_submittable_doctype';
  2. const doctype_name = custom_submittable_doctype.name;
  3. context('Report View', () => {
  4. before(() => {
  5. cy.login();
  6. cy.visit('/app/website');
  7. cy.insert_doc('DocType', custom_submittable_doctype, true);
  8. cy.clear_cache();
  9. cy.insert_doc(doctype_name, {
  10. 'title': 'Doc 1',
  11. 'description': 'Random Text',
  12. 'enabled': 0,
  13. 'docstatus': 1 // submit document
  14. }, true);
  15. });
  16. it('Field with enabled allow_on_submit should be editable.', () => {
  17. cy.intercept('POST', 'api/method/frappe.client.set_value').as('value-update');
  18. cy.visit(`/app/List/${doctype_name}/Report`);
  19. // check status column added from docstatus
  20. cy.get('.dt-row-0 > .dt-cell--col-3').should('contain', 'Submitted');
  21. let cell = cy.get('.dt-row-0 > .dt-cell--col-4');
  22. // select the cell
  23. cell.dblclick();
  24. cell.get('.dt-cell__edit--col-4').findByRole('checkbox').check({ force: true });
  25. cy.get('.dt-row-0 > .dt-cell--col-3').click(); // click outside
  26. cy.wait('@value-update');
  27. cy.call('frappe.client.get_value', {
  28. doctype: doctype_name,
  29. filters: {
  30. title: 'Doc 1',
  31. },
  32. fieldname: 'enabled'
  33. }).then(r => {
  34. expect(r.message.enabled).to.equals(1);
  35. });
  36. });
  37. });