1
0
mirror of https://github.com/lana-k/sqliteviz.git synced 2025-12-06 10:08:52 +08:00

Fix file type detection #48

file.type is empty on some Windows machines (Registry settings affects)
This commit is contained in:
lana-k
2021-05-17 21:32:09 +02:00
parent 33913f8f5c
commit aa52048d51
4 changed files with 38 additions and 17 deletions

View File

@@ -33,7 +33,7 @@ describe('DbUploader.vue', () => {
it('loads db on click and redirects to /editor', async () => {
// mock getting a file from user
const file = {}
const file = { name: 'test.db' }
sinon.stub(fu, 'getFileFromUser').resolves(file)
// mock db loading
@@ -90,7 +90,7 @@ describe('DbUploader.vue', () => {
})
// mock a file dropped by a user
const file = {}
const file = { name: 'test.db' }
const dropData = { dataTransfer: new DataTransfer() }
Object.defineProperty(dropData.dataTransfer, 'files', {
value: [file],
@@ -109,7 +109,7 @@ describe('DbUploader.vue', () => {
it("doesn't redirect if already on /editor", async () => {
// mock getting a file from user
const file = {}
const file = { name: 'test.db' }
sinon.stub(fu, 'getFileFromUser').resolves(file)
// mock db loading