2024-07-16 17:13:24 +02:00
|
|
|
import test from 'ava';
|
2025-04-17 17:39:08 +02:00
|
|
|
import { sheetRawContentToObjects } from "../exports.js"
|
2024-07-16 17:13:24 +02:00
|
|
|
|
|
|
|
|
test("Empty header value should be kept", t => {
|
|
|
|
|
const rawContent = [
|
|
|
|
|
[
|
|
|
|
|
{
|
|
|
|
|
type: "string",
|
|
|
|
|
value: "",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: "string",
|
|
|
|
|
value: "Pitchou",
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
[
|
|
|
|
|
{
|
|
|
|
|
type: "string",
|
|
|
|
|
value: "1",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: "string",
|
|
|
|
|
value: "2",
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
const object = sheetRawContentToObjects(rawContent)
|
|
|
|
|
|
|
|
|
|
t.deepEqual(
|
|
|
|
|
object,
|
|
|
|
|
[
|
|
|
|
|
{
|
|
|
|
|
"Column 1": "1",
|
|
|
|
|
"Pitchou": "2",
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
)
|
|
|
|
|
})
|