Migrate vue widget data to use refs

This commit is contained in:
Austin Mroz
2025-12-01 23:47:59 -08:00
parent 3eece91eb6
commit 47650bebf8
34 changed files with 148 additions and 262 deletions

View File

@@ -2,6 +2,7 @@ import { mount } from '@vue/test-utils'
import PrimeVue from 'primevue/config'
import InputNumber from 'primevue/inputnumber'
import { describe, expect, it } from 'vitest'
import { ref, watch } from 'vue'
import type { SimplifiedWidget } from '@/types/simplifiedWidget'
@@ -13,12 +14,13 @@ function createMockWidget(
options: SimplifiedWidget['options'] = {},
callback?: (value: number) => void
): SimplifiedWidget<number> {
const valueRef = ref(value)
if (callback) watch(valueRef, callback)
return {
name: 'test_input_number',
type,
value,
options,
callback
value: () => valueRef,
options
}
}