Browse Source

finally reached the summit of the cypress mountain

master
Martin McKeaveney 6 years ago
parent
commit
a3e813f67e
  1. BIN
      .DS_Store
  2. 16
      packages/builder/cypress/integration/createTable.spec.js
  3. 1
      packages/builder/cypress/integration/createView.spec.js
  4. 2
      packages/builder/src/components/backend/DataTable/TableHeader/TableHeader.svelte

BIN
.DS_Store

Binary file not shown.

16
packages/builder/cypress/integration/createTable.spec.js

@ -22,8 +22,10 @@ context("Create a Table", () => {
}) })
it("updates a column on the table", () => { it("updates a column on the table", () => {
cy.contains("name").click() cy.contains("header", "name")
cy.get(".ri-pencil-line").click() .trigger("mouseover")
.find(".ri-pencil-line")
.click({ force: true })
cy.get(".actions input") cy.get(".actions input")
.first() .first()
.type("updated") .type("updated")
@ -48,11 +50,13 @@ context("Create a Table", () => {
}) })
it("deletes a column", () => { it("deletes a column", () => {
cy.contains("name").click() cy
cy.get(".ri-pencil-line").click() .contains("header", "name")
cy.contains("Delete Column").click() .trigger("mouseover")
.find(".ri-pencil-line").click({ force: true })
cy.contains("Delete").click()
cy.wait(50) cy.wait(50)
cy.get(".buttons").contains("Delete Column").click() cy.get(".buttons").contains("Delete").click()
cy.contains("nameupdated").should("not.exist") cy.contains("nameupdated").should("not.exist")
}) })

1
packages/builder/cypress/integration/createView.spec.js

@ -63,6 +63,7 @@ context("Create a View", () => {
.eq(1) .eq(1)
.select("age") .select("age")
cy.contains("Save").click() cy.contains("Save").click()
cy.get(".ag-center-cols-viewport").scrollTo("100%")
cy.get("[data-cy=table-header]").then($headers => { cy.get("[data-cy=table-header]").then($headers => {
expect($headers).to.have.length(7) expect($headers).to.have.length(7)
const headers = Array.from($headers).map(header => header.textContent.trim()) const headers = Array.from($headers).map(header => header.textContent.trim())

2
packages/builder/src/components/backend/DataTable/TableHeader/TableHeader.svelte

@ -34,7 +34,7 @@
modal.show() modal.show()
} }
function setSort(column) { function setSort() {
sortDirection = column.getSort() sortDirection = column.getSort()
} }

Loading…
Cancel
Save