Skip to content

Commit

Permalink
Added test-ids
Browse files Browse the repository at this point in the history
  • Loading branch information
elsoazemelet committed Jan 20, 2025
1 parent 1860655 commit 3a627bf
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 57 deletions.
43 changes: 24 additions & 19 deletions src/renderer/config-blocks/VarGlobal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -140,25 +140,30 @@
<div class="flex flex-col gap-2">
{#each scriptSegments as script, i}
<div class="grid grid-cols-[25%_1fr_auto] gap-2 items-center">
<MeltCombo
title={" "}
bind:value={script.variable}
validator={(e) => {
return new Validator(e).NotEmpty().Result();
}}
on:validator={(e) => {
const data = e.detail;
dispatch("validator", data);
}}
on:input={(e) => {
sendData();
}}
on:change={() => {
dispatch("sync");
}}
/>
<div data-testid="variable-name">
<MeltCombo
title={" "}
bind:value={script.variable}
validator={(e) => {
return new Validator(e).NotEmpty().Result();
}}
on:validator={(e) => {
const data = e.detail;
dispatch("validator", data);
}}
on:input={(e) => {
sendData();
}}
on:change={() => {
dispatch("sync");
}}
/>
</div>

<div class="border border-black flex items-center flex-grow h-full">
<div
data-testid="variable-value"
class="border border-black flex items-center flex-grow h-full"
>
<LineEditor
on:input={(e) => {
script.value = e.detail.script ?? "";
Expand Down Expand Up @@ -195,7 +200,7 @@
{/each}
</div>

<div class="self-center">
<div data-testid="add-variable" class="self-center">
<MoltenPushButton
click={addGlobalVariable}
text={"Add New Global Variable"}
Expand Down
43 changes: 24 additions & 19 deletions src/renderer/config-blocks/VarLocals.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -140,25 +140,30 @@
<div class="flex flex-col gap-2">
{#each scriptSegments as script, i}
<div class="grid grid-cols-[25%_1fr_auto] gap-2 items-center">
<MeltCombo
title={" "}
bind:value={script.variable}
validator={(e) => {
return new Validator(e).NotEmpty().Result();
}}
on:validator={(e) => {
const data = e.detail;
dispatch("validator", data);
}}
on:input={(e) => {
sendData();
}}
on:change={() => {
dispatch("sync");
}}
/>
<div data-testid="variable-name">
<MeltCombo
title={" "}
bind:value={script.variable}
validator={(e) => {
return new Validator(e).NotEmpty().Result();
}}
on:validator={(e) => {
const data = e.detail;
dispatch("validator", data);
}}
on:input={(e) => {
sendData();
}}
on:change={() => {
dispatch("sync");
}}
/>
</div>

<div class="border border-black flex items-center flex-grow h-full">
<div
data-testid="variable-value"
class="border border-black flex items-center flex-grow h-full"
>
<LineEditor
on:input={(e) => {
script.value = e.detail.script ?? "";
Expand Down Expand Up @@ -195,7 +200,7 @@
{/each}
</div>

<div class="self-center">
<div data-testid="add-variable" class="self-center">
<MoltenPushButton
click={addLocalVariable}
text={"Add New Local Variable"}
Expand Down
43 changes: 24 additions & 19 deletions src/renderer/config-blocks/VarSelf.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -144,25 +144,30 @@
<div class="flex flex-col gap-2">
{#each scriptSegments as script, i}
<div class="grid grid-cols-[25%_1fr_auto] gap-2 items-center">
<MeltCombo
title={" "}
bind:value={script.variable}
validator={(e) => {
return new Validator(e).NotEmpty().Result();
}}
on:validator={(e) => {
const data = e.detail;
dispatch("validator", data);
}}
on:input={(e) => {
sendData();
}}
on:change={() => {
dispatch("sync");
}}
/>
<div data-testid="variable-name">
<MeltCombo
title={" "}
bind:value={script.variable}
validator={(e) => {
return new Validator(e).NotEmpty().Result();
}}
on:validator={(e) => {
const data = e.detail;
dispatch("validator", data);
}}
on:input={(e) => {
sendData();
}}
on:change={() => {
dispatch("sync");
}}
/>
</div>

<div class="border border-black flex items-center flex-grow h-full">
<div
data-testid="variable-value"
class="border border-black flex items-center flex-grow h-full"
>
<LineEditor
on:input={(e) => {
script.value = e.detail.script ?? "";
Expand Down Expand Up @@ -199,7 +204,7 @@
{/each}
</div>

<div class="self-center">
<div data-testid="add-variable" class="self-center">
<MoltenPushButton
click={addSelfVariable}
text={"Add New Self Variable"}
Expand Down

0 comments on commit 3a627bf

Please sign in to comment.