You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

39 rivejä
1.3 KiB

  1. describe("configuration options: `urls` and `urls.primaryName`", () => {
  2. describe("`urls` only", () => {
  3. it("should render a list of URLs correctly", () => {
  4. cy.visit("/?configUrl=/configs/urls.yaml")
  5. .get("select")
  6. .children()
  7. .should("have.length", 2)
  8. .get("select > option")
  9. .eq(0)
  10. .should("have.text", "One")
  11. .should("have.attr", "value", "/documents/features/urls/1.yaml")
  12. .get("select > option")
  13. .eq(1)
  14. .should("have.text", "Two")
  15. .should("have.attr", "value", "/documents/features/urls/2.yaml")
  16. })
  17. it("should render the first URL in the list", () => {
  18. cy.visit("/?configUrl=/configs/urls.yaml")
  19. .get("h2.title")
  20. .should("have.text", "One")
  21. .window()
  22. .then(win => win.ui.specSelectors.url())
  23. .should("equal", "/documents/features/urls/1.yaml")
  24. })
  25. })
  26. it("should respect a `urls.primaryName`", () => {
  27. cy.visit("/?configUrl=/configs/urls-primary-name.yaml")
  28. .get("select")
  29. .should("have.value", "/documents/features/urls/2.yaml")
  30. .get("h2.title")
  31. .should("have.text", "Two")
  32. .window()
  33. .then(win => win.ui.specSelectors.url())
  34. .should("equal", "/documents/features/urls/2.yaml")
  35. })
  36. })