1
0
Fork 0
mirror of synced 2024-09-29 08:41:16 +13:00

fix cypress test

This commit is contained in:
Maurits Lourens 2021-07-27 23:48:06 +02:00
parent cd4d40fb47
commit 8c4333f4ca
4 changed files with 9 additions and 5 deletions

View file

@ -6,15 +6,18 @@
export let id = null
export let text = null
export let disabled = false
export let dataCy = null
const dispatch = createEventDispatcher()
const onChange = event => {
dispatch("change", event.target.checked)
}
</script>
<div class="spectrum-Switch spectrum-Switch--emphasized">
<input
data-cy={dataCy}
checked={value}
{disabled}
on:change={onChange}

View file

@ -9,6 +9,7 @@
export let text = null
export let disabled = false
export let error = null
export let dataCy = null
const dispatch = createEventDispatcher()
const onChange = e => {
@ -18,5 +19,5 @@
</script>
<Field {label} {labelPosition} {error}>
<Switch {error} {disabled} {text} {value} on:change={onChange} />
<Switch {dataCy} {error} {disabled} {text} {value} on:change={onChange} />
</Field>

View file

@ -29,10 +29,10 @@ context("Create a automation", () => {
cy.get(".setup").within(() => {
cy.get(".spectrum-Picker-label").click()
cy.contains("dog").click()
cy.get("input")
cy.get(".spectrum-Textfield-input")
.first()
.type("goodboy")
cy.get("input")
cy.get(".spectrum-Textfield-input")
.eq(1)
.type("11")
})
@ -41,7 +41,7 @@ context("Create a automation", () => {
cy.contains("Save Automation").click()
// Activate Automation
cy.get("[aria-label=PlayCircle]").click()
cy.get("[data-cy=activate-automation]").click()
})
it("should add row when a new row is added", () => {

View file

@ -51,7 +51,7 @@
<Toggle
value={automationLive}
on:change={() => setAutomationLive(!automationLive)}
data-cy="activate-automation"
dataCy="activate-automation"
text="Live"
/>
</div>