-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: remove unsed vars & cleanups #437
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Spreadsheet querying deep join works 1`] = `"=from transactions where acct.offbudget = 0 and (description.transfer_acct.offbudget = null or description.transfer_acct.offbudget = 1) select { acct.offbudget, description.transfer_acct.offbudget as foo, amount }"`; | ||
|
||
exports[`Spreadsheet querying transactions works 1`] = `"=from transactions select { amount, category }"`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -183,7 +183,7 @@ export default class Spreadsheet { | |
this.events.emit('change', { names: this.computeQueue }); | ||
|
||
// Cache the updated cells | ||
if (this.saveCache) { | ||
if (typeof this.saveCache === 'function') { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Making the tests pass. |
||
this.saveCache(this.computeQueue); | ||
} | ||
this.markCacheSafe(); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,8 +8,6 @@ function wait(n) { | |
return new Promise(resolve => setTimeout(resolve, n)); | ||
} | ||
|
||
// TODO: re-enable and fix these tests | ||
// eslint-disable-next-line no-unused-vars | ||
async function insertTransactions(payeeId = null) { | ||
await db.insertAccount({ id: '1', name: 'checking', offbudget: 0 }); | ||
await db.insertAccount({ id: '2', name: 'checking', offbudget: 1 }); | ||
|
@@ -20,7 +18,7 @@ async function insertTransactions(payeeId = null) { | |
await db.insertTransaction( | ||
generateTransaction({ | ||
amount: -3200, | ||
acct: '1', | ||
account: '1', | ||
category: 'cat1', | ||
date: '2017-01-08', | ||
description: payeeId | ||
|
@@ -29,7 +27,7 @@ async function insertTransactions(payeeId = null) { | |
await db.insertTransaction( | ||
generateTransaction({ | ||
amount: -2800, | ||
acct: '1', | ||
account: '1', | ||
category: 'cat2', | ||
date: '2017-01-10', | ||
description: payeeId | ||
|
@@ -38,7 +36,7 @@ async function insertTransactions(payeeId = null) { | |
await db.insertTransaction( | ||
generateTransaction({ | ||
amount: -9832, | ||
acct: '1', | ||
account: '1', | ||
category: 'cat2', | ||
date: '2017-01-15', | ||
description: payeeId | ||
|
@@ -109,40 +107,40 @@ describe('Spreadsheet', () => { | |
// }); | ||
// }); | ||
|
||
// test('querying transactions works', async () => { | ||
// const spreadsheet = new Spreadsheet(db); | ||
// await insertTransactions(); | ||
|
||
// spreadsheet.startTransaction(); | ||
// spreadsheet.set('g!foo', `=from transactions select { amount, category }`); | ||
// spreadsheet.endTransaction(); | ||
|
||
// return new Promise(resolve => { | ||
// spreadsheet.onFinish(() => { | ||
// expect(spreadsheet.getValue('g!foo')).toMatchSnapshot(); | ||
// resolve(); | ||
// }); | ||
// }); | ||
// }); | ||
test('querying transactions works', async () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only uncommenting these tests. No changes in them. |
||
const spreadsheet = new Spreadsheet(db); | ||
await insertTransactions(); | ||
|
||
// test('querying deep join works', async () => { | ||
// const spreadsheet = new Spreadsheet(db); | ||
// let payeeId1 = await db.insertPayee({ name: '', transfer_acct: '1' }); | ||
// let payeeId2 = await db.insertPayee({ name: '', transfer_acct: '2' }); | ||
// await insertTransactions(payeeId2); | ||
spreadsheet.startTransaction(); | ||
spreadsheet.set('g!foo', `=from transactions select { amount, category }`); | ||
spreadsheet.endTransaction(); | ||
|
||
// spreadsheet.set( | ||
// 'g!foo', | ||
// '=from transactions where acct.offbudget = 0 and (description.transfer_acct.offbudget = null or description.transfer_acct.offbudget = 1) select { acct.offbudget, description.transfer_acct.offbudget as foo, amount }' | ||
// ); | ||
return new Promise(resolve => { | ||
spreadsheet.onFinish(() => { | ||
expect(spreadsheet.getValue('g!foo')).toMatchSnapshot(); | ||
resolve(); | ||
}); | ||
}); | ||
}); | ||
|
||
// return new Promise(resolve => { | ||
// spreadsheet.onFinish(() => { | ||
// expect(spreadsheet.getValue('g!foo')).toMatchSnapshot(); | ||
// resolve(); | ||
// }); | ||
// }); | ||
// }); | ||
test('querying deep join works', async () => { | ||
const spreadsheet = new Spreadsheet(db); | ||
await db.insertPayee({ name: '', transfer_acct: '1' }); | ||
let payeeId2 = await db.insertPayee({ name: '', transfer_acct: '2' }); | ||
await insertTransactions(payeeId2); | ||
|
||
spreadsheet.set( | ||
'g!foo', | ||
'=from transactions where acct.offbudget = 0 and (description.transfer_acct.offbudget = null or description.transfer_acct.offbudget = 1) select { acct.offbudget, description.transfer_acct.offbudget as foo, amount }' | ||
); | ||
|
||
return new Promise(resolve => { | ||
spreadsheet.onFinish(() => { | ||
expect(spreadsheet.getValue('g!foo')).toMatchSnapshot(); | ||
resolve(); | ||
}); | ||
}); | ||
}); | ||
|
||
test('async cells work', done => { | ||
const spreadsheet = new Spreadsheet(); | ||
|
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Throws an exception if the vars are invalid, so we can't remove it.