Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

Removed duplicates in Crop Dropdown when editing a record #176

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
const dayjs = require("dayjs")

describe("Test the harvest report default values", () => {
beforeEach(() => {
cy.login("manager1", "farmdata2")
cy.visit("/farm/fd2-barn-kit/seedingReport")
})
it("Checks table header", () => {
cy.get("[class=text-center]").should("have.text","Seeding Report")
})
it("Checks for 'Set Dates' section ", () => {
cy.get("[class=panel-heading]").should("have.text","Set Dates")
})
it("Checks the button has the label Generate Report ", () => {
cy.get("[data-cy=generate-rpt-btn]").should("have.text","Generate Report")
})
it("Checks that the Start Date is the first day of the year ", () => {
cy.get('[data-cy=date-select]')
.each(($el, index, $all) => {
if (index == 0) {
expect($el).to.have.value('2023-01-01')
}
})

})
it("Checks that the default end date is the current date", () => {
let currentDate = dayjs().format("YYYY-MM-DD")
cy.get("[data-cy=date-select]")
.each(($el, index, $all) => {
if (index == 1) {
expect($el).to.have.value(currentDate)
}
})
})
it("Checks that the remainder of the report is not visible", () => {
cy.get("[data-cy=filters-panel]").should("not.exist")
cy.get("[data-cy=report-table").should("not.exist")
cy.get("[data-cy=direct-summary").should("not.exist")
cy.get("[data-cy=tray-summary").should("not.exist")
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -845,10 +845,6 @@ <h1 class="text-center">Seeding Report</h1>
getCropToIDMap()
.then((response) => {
this.cropToIDMap = new Map(response)
this.cropNameArray = []
for(let [key, info] of this.cropToIDMap){
this.cropNameArray.push(key)
}
this.createdCount++
})
.catch((err) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const dayjs = require("dayjs")

describe("Test the seeding report summary values values", () => {
beforeEach(() => {
cy.login("manager1", "farmdata2")
cy.visit("/farm/fd2-barn-kit/seedingReport")
cy.get('[data-cy=start-date-select]').type('2020-05-05')
cy.get('[data-cy=end-date-select]').type('2020-05-06')
cy.get('[data-cy=generate-rpt-btn]').click()
cy.get('[data-cy=r0-edit-button]').click()

})
it("Tests crop list length", () => {
cy.get('[data-cy=r0-Crop-input]').children().should('have.length',111)
})

})
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const dayjs = require("dayjs")

describe("Test the seeding report summary values values", () => {
beforeEach(() => {
cy.login("manager1", "farmdata2")
cy.visit("/farm/fd2-barn-kit/seedingReport")
cy.get('[data-cy=start-date-select').type('2020-05-05')
cy.get('[data-cy=end-date-select').type('2020-05-06')
cy.get('[data-cy=generate-rpt-btn').click()
cy.get('[data-cy=crop-dropdown] > [data-cy=dropdown-input]').select('BEAN')
})
it("Tests total row feet planted", () => {
cy.get('[data-cy=direct-total-rowft').should('have.text',210)
})
it("Tests total bed feet planted summary value", () => {
cy.get('[data-cy=direct-total-bedft').should('have.text',105)
})
it("Tests total hours summary value", () => {
cy.get('[data-cy=direct-total-hours').should('have.text',.06)
})
it("Tests Average row feet/hr summary value", () => {
cy.get('[data-cy=direct-total-rowft-hour').should('have.text',3500)
})
it("Tests Average bed feet/hr summary value", () => {
cy.get('[data-cy=direct-total-bedfr-hour').should('have.text',1750)
})
})