mirror of
https://github.com/sky-systems/sky_phone.git
synced 2026-09-04 17:23:25 +00:00
FIX - clone custom app frame messages
This commit is contained in:
@@ -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()
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user