Files
windmill/frontend/src/lib/components/s3TableOps.test.ts
T
9fa9b77926 feat: redesign the s3 explorer and show data files as tables (#11642)
* feat: restyle s3 explorer tree like the db manager tree

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* feat: make s3 explorer flush with its drawer

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* feat: show s3 file preview as an inset card

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* feat: redesign s3 explorer file header

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* feat: move s3 csv preview options into the file header band

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix: narrow the s3 csv separator select

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* feat: show csv, parquet and json files as tables in the s3 explorer

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix: keep the detected s3 csv separator shown in text view

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix: drop stale s3 table responses and unfilterable nested columns

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore: pin ee ref for the s3 table decimal filter fix

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore: pin ee ref for the s3 table decimal scale fix

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore: pin ee ref for strict s3 table decimal filter parsing

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore: pin ee ref for the s3 decimal exponent bound

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore: update ee-repo-ref to 06610ecc950ed64a2709d7f1aa8c7b49a95fdbae

This commit updates the EE repository reference after PR #869 was merged in windmill-ee-private.

Previous ee-repo-ref: 74f041e9767f2ac612e21f351f96e71c584e2904

New ee-repo-ref: 06610ecc950ed64a2709d7f1aa8c7b49a95fdbae

Automated by sync-ee-ref workflow.

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: windmill-internal-app[bot] <windmill-internal-app[bot]@users.noreply.github.com>
2026-10-11 23:29:05 +02:00

45 lines
1.7 KiB
TypeScript

import { describe, expect, it } from 'vitest'
import { datatypeOf, jsonTableRows, serverTableFormat } from './s3TableOps'
import { dbColumnKind } from './dbTableFilters'
describe('serverTableFormat', () => {
it('pages delimited text and newline-delimited JSON through the csv reader', () => {
expect(serverTableFormat('a/b.parquet')).toBe('parquet')
for (const key of ['a.csv', 'a.TSV', 'a.jsonl', 'a.ndjson']) {
expect(serverTableFormat(key)).toBe('csv')
}
})
it('leaves plain JSON to the browser', () => {
expect(serverTableFormat('a.json')).toBeUndefined()
expect(serverTableFormat('a.txt')).toBeUndefined()
})
})
describe('datatypeOf', () => {
it('maps Arrow types to the kinds the grid filters by', () => {
expect(dbColumnKind(datatypeOf('Int64'))).toBe('number')
expect(dbColumnKind(datatypeOf('UInt8'))).toBe('number')
expect(dbColumnKind(datatypeOf('Float64'))).toBe('number')
expect(dbColumnKind(datatypeOf('Decimal128(21, 1)'))).toBe('number')
expect(dbColumnKind(datatypeOf('Boolean'))).toBe('boolean')
expect(dbColumnKind(datatypeOf('Utf8View'))).toBe('text')
})
it('names a nested type without its field list', () => {
expect(datatypeOf('List(Field { name: "item", data_type: Utf8 })')).toBe('list')
expect(datatypeOf('Timestamp(Microsecond, None)')).toBe('timestamp')
})
})
describe('jsonTableRows', () => {
it('keeps objects and wraps other elements in a value column', () => {
expect(jsonTableRows([{ a: 1 }, 2, null])).toEqual([{ a: 1 }, { value: 2 }, { value: null }])
})
it('has no table for an empty array or a non-array', () => {
expect(jsonTableRows([])).toBeUndefined()
expect(jsonTableRows({ a: 1 })).toBeUndefined()
})
})