mirror of
https://github.com/tenrok/vue-select.git
synced 2026-05-17 02:29:37 +03:00
98c278b2bb
BREAKING: mixins are no longer exported from the index (and will likely be converted to hooks)
17 lines
517 B
JavaScript
17 lines
517 B
JavaScript
import { test, expect } from 'vitest'
|
|
import sortAndStringify from '@/utility/sortAndStringify'
|
|
|
|
test('it will stringify an object', () => {
|
|
expect(sortAndStringify({ hello: 'world' })).toEqual('{"hello":"world"}')
|
|
})
|
|
|
|
test('it will sort attributes alphabetically', () => {
|
|
expect(sortAndStringify({ b: 'b', a: 'a' })).toEqual('{"a":"a","b":"b"}')
|
|
})
|
|
|
|
test('comparing two objects with unsorted keys', () => {
|
|
expect(sortAndStringify({ b: 'b', a: 'a' })).toEqual(
|
|
sortAndStringify({ a: 'a', b: 'b' })
|
|
)
|
|
})
|