Fix unit tests and use trueLabel not onLabel to not confuse vue mocks

This commit is contained in:
Julian Stirling 2026-06-23 16:32:39 +01:00
parent 0e24bb01f4
commit 58dd3f2afe
3 changed files with 9 additions and 6 deletions

View file

@ -20,12 +20,12 @@ export default {
type: String,
default: undefined,
},
offLabel: {
falseLabel: {
required: false,
type: String,
default: undefined,
},
onLabel: {
trueLabel: {
required: false,
type: String,
default: undefined,
@ -36,10 +36,10 @@ export default {
computed: {
showStateLabel() {
return this.onLabel !== undefined && this.offLabel !== undefined;
return this.trueLabel !== undefined && this.falseLabel !== undefined;
},
stateLabelText() {
return this.modelValue ? this.onLabel : this.offLabel;
return this.modelValue ? this.trueLabel : this.falseLabel;
},
},

View file

@ -5,8 +5,8 @@
<toggle-switch
v-model="saveToGallery"
label-text="Save to Gallery?"
on-label="Saving"
off-label="Downloading"
true-label="Saving"
false-label="Downloading"
/>
<div class="uk-margin">

View file

@ -54,6 +54,9 @@ export const componentOverrides = {
"matrixDisplay.vue": {
props: { matrix: [] },
},
"toggleSwitch.vue": {
props: { modelValue: true },
},
"actionProgressBar.vue": {
props: { taskStatus: "" },
},