2024-06-18 11:06:41 +02:00
|
|
|
import {readFile} from 'node:fs/promises'
|
|
|
|
|
|
|
|
|
|
import test from 'ava';
|
|
|
|
|
|
2025-04-17 17:39:08 +02:00
|
|
|
import {getODSTableRawContent} from '../exports.js'
|
2024-06-18 11:06:41 +02:00
|
|
|
|
2025-04-26 19:59:44 +02:00
|
|
|
const nomAgeContent = (await readFile('./tests/fixtures/nom-age.ods')).buffer
|
2024-06-18 11:06:41 +02:00
|
|
|
|
|
|
|
|
test('basic', async t => {
|
|
|
|
|
const table = await getODSTableRawContent(nomAgeContent);
|
|
|
|
|
t.assert(table.has('Feuille1'))
|
|
|
|
|
|
|
|
|
|
const feuille1 = table.get('Feuille1')
|
|
|
|
|
t.assert(Array.isArray(feuille1))
|
|
|
|
|
//@ts-ignore
|
|
|
|
|
t.assert(Array.isArray(feuille1[0]))
|
|
|
|
|
//@ts-ignore
|
|
|
|
|
t.deepEqual(feuille1[0][0], {value: 'Nom', type: 'string'})
|
|
|
|
|
});
|