FIX - clone custom app frame messages

This commit is contained in:
Leon.Schmidt
2026-08-11 21:46:40 +02:00
parent dc401e2b87
commit 5d984b5efe
2 changed files with 22 additions and 1 deletions
+20
View File
@@ -0,0 +1,20 @@
import { reactive } from 'vue'
import { describe, expect, it } from 'vitest'
import { cloneJsonData } from '@/utils/clone'
describe('JSON data cloning', () => {
it('turns reactive custom app payloads into structured-cloneable data', () => {
const payload = reactive({
action: 'setSpeedCameras',
data: [{ id: 1, label: 'Alta Street' }],
})
expect(() => structuredClone(payload)).toThrow()
const cloned = cloneJsonData(payload)
expect(cloned).toEqual(payload)
expect(() => structuredClone(cloned)).not.toThrow()
})
})