fix: sql guard gaps, date tz, timeouts, payload
This commit is contained in:
@@ -89,6 +89,35 @@ describe('registry', () => {
|
||||
expect(() => registry.update('u', { host: '' })).toThrow()
|
||||
})
|
||||
|
||||
it('drops the inherited port when switching engine without a new port', () => {
|
||||
writeStore(storePath, [conn('switch', { type: 'postgres', port: 5432 })])
|
||||
const registry = createRegistry({ storePath, env: {} })
|
||||
const updated = registry.update('switch', { type: 'mysql' })
|
||||
expect(updated.config.type).toBe('mysql')
|
||||
expect(updated.config.port).toBeUndefined()
|
||||
})
|
||||
|
||||
it('keeps an explicit port when switching engine', () => {
|
||||
writeStore(storePath, [conn('switch', { type: 'postgres', port: 5432 })])
|
||||
const registry = createRegistry({ storePath, env: {} })
|
||||
const updated = registry.update('switch', { type: 'mysql', port: 3307 })
|
||||
expect(updated.config.port).toBe(3307)
|
||||
})
|
||||
|
||||
it('clears the port when switching engine with an explicit null', () => {
|
||||
writeStore(storePath, [conn('switch', { type: 'postgres', port: 5432 })])
|
||||
const registry = createRegistry({ storePath, env: {} })
|
||||
const updated = registry.update('switch', { type: 'mysql', port: null })
|
||||
expect(updated.config.port).toBeUndefined()
|
||||
})
|
||||
|
||||
it('keeps the port when type is unchanged', () => {
|
||||
writeStore(storePath, [conn('same', { type: 'postgres', port: 5432 })])
|
||||
const registry = createRegistry({ storePath, env: {} })
|
||||
const updated = registry.update('same', { readonly: true })
|
||||
expect(updated.config.port).toBe(5432)
|
||||
})
|
||||
|
||||
it('update can rename unless the new name is taken', () => {
|
||||
writeStore(storePath, [conn('old-name'), conn('taken')])
|
||||
const registry = createRegistry({ storePath, env: {} })
|
||||
|
||||
Reference in New Issue
Block a user