test: Update demo e2e tests for new canvas (no-changelog) (#12488)

This commit is contained in:
Alex Grozav 2025-01-07 19:05:52 +02:00 committed by GitHub
parent 04e2928d34
commit 976586fbfd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 4 deletions

View file

@ -46,7 +46,10 @@ export function getNodes() {
}
export function getNodeByName(name: string) {
return cy.getByTestId('canvas-node').filter(`[data-name="${name}"]`).eq(0);
return cy.ifCanvasVersion(
() => cy.getByTestId('canvas-node').filter(`[data-name="${name}"]`).eq(0),
() => cy.getByTestId('canvas-node').filter(`[data-node-name="${name}"]`).eq(0),
);
}
export function disableNode(name: string) {

View file

@ -311,7 +311,12 @@ onBeforeUnmount(() => {
</script>
<template>
<div :class="classes" data-test-id="canvas-node" :data-node-type="data.type">
<div
:class="classes"
data-test-id="canvas-node"
:data-node-name="data.name"
:data-node-type="data.type"
>
<template
v-for="source in mappedOutputs"
:key="`${source.handleId}(${source.index + 1}/${mappedOutputs.length})`"
@ -321,7 +326,7 @@ onBeforeUnmount(() => {
:mode="CanvasConnectionMode.Output"
:is-read-only="readOnly"
:is-valid-connection="isValidConnection"
:data-node-name="label"
:data-node-name="data.name"
data-test-id="canvas-node-output-handle"
:data-handle-index="source.index"
@add="onAdd"
@ -339,7 +344,7 @@ onBeforeUnmount(() => {
:is-valid-connection="isValidConnection"
data-test-id="canvas-node-input-handle"
:data-handle-index="target.index"
:data-node-name="label"
:data-node-name="data.name"
@add="onAdd"
/>
</template>