test: add Pinia setup to proxyWidget tests for WidgetValueStore

Amp-Thread-ID: https://ampcode.com/threads/T-019c2570-5dc2-7518-b20b-2b87f14bb2f3
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Alexander Brown
2026-02-03 14:05:23 -08:00
parent 85c6bd132c
commit 61403ea426

View File

@@ -1,4 +1,6 @@
import { describe, expect, test, vi } from 'vitest'
import { createTestingPinia } from '@pinia/testing'
import { setActivePinia } from 'pinia'
import { beforeEach, describe, expect, test, vi } from 'vitest'
import { registerProxyWidgets } from '@/core/graph/subgraph/proxyWidget'
import { promoteWidget } from '@/core/graph/subgraph/proxyWidgetUtils'
@@ -43,6 +45,10 @@ function setupSubgraph(
}
describe('Subgraph proxyWidgets', () => {
beforeEach(() => {
setActivePinia(createTestingPinia({ stubActions: false }))
})
test('Can add simple widget', () => {
const [subgraphNode, innerNodes] = setupSubgraph(1)
innerNodes[0].addWidget('text', 'stringWidget', 'value', () => {})