6158.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. describe("#6158: read-only property is not hidden in `POST/PUT`", () => {
  2. describe("POST", () => {
  3. it("should hide property 'id'", () => {
  4. cy.visit("/?url=/documents/bugs/6158.yaml")
  5. .get("#operations-User-post_users")
  6. .click()
  7. .get(".parameters[data-property-name='id']")
  8. .should("not.exist")
  9. .get(".parameters[data-property-name='name']")
  10. .should("exist")
  11. })
  12. it("should hide property 'id' when trying it out", () => {
  13. cy.visit("/?url=/documents/bugs/6158.yaml")
  14. .get("#operations-User-post_users")
  15. .click()
  16. .get(".try-out__btn")
  17. .click()
  18. .get(".parameters[data-property-name='id']")
  19. .should("not.exist")
  20. .get("input[placeholder='id']")
  21. .should("not.exist")
  22. .get(".parameters[data-property-name='name']")
  23. .should("exist")
  24. .get("input[placeholder='name']")
  25. .should("exist")
  26. })
  27. })
  28. describe("PUT", () => {
  29. it("should hide property 'id'", () => {
  30. cy.visit("/?url=/documents/bugs/6158.yaml")
  31. .get("#operations-User-put_users")
  32. .click()
  33. .get(".parameters[data-property-name='id']")
  34. .should("not.exist")
  35. .get(".parameters[data-property-name='name']")
  36. .should("exist")
  37. })
  38. it("should hide property 'id' when trying it out", () => {
  39. cy.visit("/?url=/documents/bugs/6158.yaml")
  40. .get("#operations-User-put_users")
  41. .click()
  42. .get(".try-out__btn")
  43. .click()
  44. .get(".parameters[data-property-name='id']")
  45. .should("not.exist")
  46. .get("input[placeholder='id']")
  47. .should("not.exist")
  48. .get(".parameters[data-property-name='name']")
  49. .should("exist")
  50. .get("input[placeholder='name']")
  51. .should("exist")
  52. })
  53. })
  54. })