2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-05-26 04:34:04 +03:00
Files
vue-select/tests/unit/utility/sortAndStringify.spec.js
T
Jeff Sagal 9572207527 convert tests
did enableMouseSearchInput get dropped in a merge?
2022-02-18 15:35:23 -08:00

17 lines
528 B
JavaScript

import { test, expect } from 'vitest'
import sortAndStringify from '../../../src/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' })
)
})