teqo-backup/tests/unit/plazaUi.unit.spec.ts
Francisco Ignácio Fontoura Solla 248f896d05 Deliver auto-applied filters on Praças list and close filtros-auto fill-in.
Remove the Buscar step with debounced search, immediate select navigation, and pending UI; update roadmap, plan, and notebook.
2026-07-21 12:54:23 -03:00

16 lines
670 B
TypeScript

import { describe, expect, it } from 'vitest'
import { shouldUpdatePlazaSearchUrl } from '@/utilities/plazaUi'
describe('shouldUpdatePlazaSearchUrl', () => {
it('returns false when canonical q matches the current URL q', () => {
expect(shouldUpdatePlazaSearchUrl('salvador', 'salvador')).toBe(false)
expect(shouldUpdatePlazaSearchUrl(' salvador ', 'salvador')).toBe(false)
})
it('returns true when q differs or is newly set', () => {
expect(shouldUpdatePlazaSearchUrl('salv', 'salvador')).toBe(true)
expect(shouldUpdatePlazaSearchUrl('salvador', undefined)).toBe(true)
expect(shouldUpdatePlazaSearchUrl('', 'salvador')).toBe(true)
})
})