|
| 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 | + |
| 18 | + it("should render the first URL in the list", () => { |
| 19 | + cy.visit("/?configUrl=/configs/urls.yaml") |
| 20 | + .get("h2.title") |
| 21 | + .should("have.text", "One") |
| 22 | + .window() |
| 23 | + .then(win => win.ui.specSelectors.url()) |
| 24 | + .should("equal", "/documents/features/urls/1.yaml") |
| 25 | + }) |
| 26 | + }) |
| 27 | + |
| 28 | + it("should respect a `urls.primaryName`", () => { |
| 29 | + cy.visit("/?configUrl=/configs/urls-primary-name.yaml") |
| 30 | + .get("select") |
| 31 | + .should("have.value", "/documents/features/urls/2.yaml") |
| 32 | + .get("h2.title") |
| 33 | + .should("have.text", "Two") |
| 34 | + .window() |
| 35 | + .then(win => win.ui.specSelectors.url()) |
| 36 | + .should("equal", "/documents/features/urls/2.yaml") |
| 37 | + }) |
| 38 | +}) |
0 commit comments