1
0
mirror of https://github.com/lana-k/sqliteviz.git synced 2025-12-07 02:28:54 +08:00
This commit is contained in:
lana-k
2025-03-20 22:04:15 +01:00
parent 5e2b34a856
commit 0c1b91ab2f
146 changed files with 3317 additions and 2438 deletions

View File

@@ -24,7 +24,9 @@ describe('fileIo.js', () => {
expect(document.createElement.calledOnceWith('a')).to.equal(true)
expect(window.Blob.calledOnceWith(['foo'], { type: 'octet/stream' })).to.equal(true)
expect(
window.Blob.calledOnceWith(['foo'], { type: 'octet/stream' })
).to.equal(true)
const blob = window.Blob.returnValues[0]
expect(URL.createObjectURL.calledOnceWith(blob)).to.equal(true)
@@ -49,7 +51,9 @@ describe('fileIo.js', () => {
expect(document.createElement.calledOnceWith('a')).to.equal(true)
expect(window.Blob.calledOnceWith(['foo'], { type: 'text/html' })).to.equal(true)
expect(window.Blob.calledOnceWith(['foo'], { type: 'text/html' })).to.equal(
true
)
const blob = window.Blob.returnValues[0]
expect(URL.createObjectURL.calledOnceWith(blob)).to.equal(true)
@@ -74,7 +78,9 @@ describe('fileIo.js', () => {
sinon.stub(document, 'createElement').returns(spyInput)
setTimeout(() => { spyInput.dispatchEvent(new Event('change')) })
setTimeout(() => {
spyInput.dispatchEvent(new Event('change'))
})
const data = await fIo.importFile()
expect(data).to.equal('foo')
@@ -108,7 +114,9 @@ describe('fileIo.js', () => {
sinon.stub(window, 'FileReader').returns(r)
const blob = new Blob(['foo'])
await expect(fIo.readAsArrayBuffer(blob)).to.be.rejectedWith('Problem parsing input file.')
await expect(fIo.readAsArrayBuffer(blob)).to.be.rejectedWith(
'Problem parsing input file.'
)
})
it('isJSON', () => {