Skip to content

Commit

Permalink
test: improve render EditDialog with jobs and vehicles
Browse files Browse the repository at this point in the history
  • Loading branch information
Seli0303 committed Oct 1, 2024
1 parent cc54f54 commit 5d0af4f
Showing 1 changed file with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,14 @@ const i18n = I18nBuilder.build()

describe('<EditDialog />', () => {
const skills= [Skill.fromObject({id: 1, name: 'heating'})]
const jobs = [Job.fromObject({
id: 1,
location: [8.67400646209717,49.41703189076835],
delivery: [1]
}),
Job.fromObject({
id: 2,
location: [8.690314292907717,49.4144633204352],
service: 2400,
delivery: [2],
pickup: [3]
})]
const jobs = [
Job.fromObject({
id: 1,
location: [8.690314292907717,49.4144633204352],
service: 2400,
delivery: [2],
pickup: [3]
})]
const vehicles = [
Vehicle.fromObject({
id: 1,
Expand All @@ -31,8 +27,8 @@ describe('<EditDialog />', () => {
}),
Vehicle.fromObject({
id: 2,
start: [8.68773937225342,49.4212474050559],
end: [8.68773937225342,49.4212474050559],
start: [8.667955398559572,49.41915365183029],
end: [8.68597984313965,49.41281601436811],
profile: 'driving-car',
capacity: [10]
})
Expand All @@ -50,12 +46,14 @@ describe('<EditDialog />', () => {
data: jobs, skills: skills, editProp: 'jobs'
}, i18n: i18n, store: store
})
cy.get('[data-cy="dataCards"]').should('have.length', 1)
})
it('renders with vehicles', () => {
cy.mount(EditDialog, {
propsData: {
data: vehicles, skills: skills, editProp: 'vehicles'
}, i18n: i18n, store: store
})
cy.get('[data-cy="dataCards"]').should('have.length', 2)
})
})

0 comments on commit 5d0af4f

Please sign in to comment.