Adjust 🔬 unit-tests according to change related to bug #10
This commit is contained in:
parent
c9cc0857c6
commit
d6b576a50e
1 changed files with 5 additions and 5 deletions
|
|
@ -241,19 +241,19 @@ describe(`core::buildURI`, () =>{
|
|||
});
|
||||
|
||||
it(`generates CSV string according to "separator"`, () => {
|
||||
const prefixCsvURI= `data:text/csv;charset=utf-8,`;
|
||||
const prefixCsvURI= `data:text/csv;charset=utf-8,\uFEFF,`;
|
||||
const expectedSepartorCount = fixtures.arrays.map(row => row.length -1).reduce((total, next) =>total + next, 0);
|
||||
let separator = ';';
|
||||
let fullURI = buildURI(fixtures.arrays,null , separator);
|
||||
let fullURI = buildURI(fixtures.arrays, null , separator);
|
||||
|
||||
expect(
|
||||
fullURI.slice(prefixCsvURI.length).match(/;/g).length
|
||||
).toEqual(expectedSepartorCount);
|
||||
|
||||
separator = ',';
|
||||
fullURI = buildURI(fixtures.arrays,null , separator);
|
||||
separator = ':'; // any separator
|
||||
fullURI = buildURI(fixtures.arrays, null , separator);
|
||||
expect(
|
||||
fullURI.slice(prefixCsvURI.length).match(/,/g).length
|
||||
fullURI.slice(prefixCsvURI.length).match(/:/g).length
|
||||
).toEqual(expectedSepartorCount);
|
||||
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue