forked from actualbudget/actual-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'org/master' into feature/pluggy.ai
- Loading branch information
Showing
23 changed files
with
169 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 101 additions & 0 deletions
101
src/app-gocardless/banks/tests/ssk_dusseldorf_dussdeddxxx.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
import { jest } from '@jest/globals'; | ||
import SskDusseldorfDussdeddxxx from '../ssk_dusseldorf_dussdeddxxx.js'; | ||
|
||
describe('ssk_dusseldorf_dussdeddxxx', () => { | ||
let consoleSpy; | ||
|
||
beforeEach(() => { | ||
consoleSpy = jest.spyOn(console, 'debug'); | ||
}); | ||
|
||
afterEach(() => { | ||
consoleSpy.mockRestore(); | ||
}); | ||
|
||
describe('#normalizeTransaction', () => { | ||
const bookedTransactionOne = { | ||
transactionId: '2024102900000000-1', | ||
bookingDate: '2024-10-29', | ||
valueDate: '2024-10-29', | ||
transactionAmount: { | ||
amount: '-99.99', | ||
currency: 'EUR', | ||
}, | ||
creditorName: 'a useful creditor name', | ||
remittanceInformationStructured: 'structured information', | ||
remittanceInformationUnstructured: 'unstructured information', | ||
additionalInformation: 'some additional information', | ||
}; | ||
|
||
const bookedTransactionTwo = { | ||
transactionId: '2024102900000000-2', | ||
bookingDate: '2024-10-29', | ||
valueDate: '2024-10-29', | ||
transactionAmount: { | ||
amount: '-99.99', | ||
currency: 'EUR', | ||
}, | ||
creditorName: 'a useful creditor name', | ||
ultimateCreditor: 'ultimate creditor', | ||
remittanceInformationStructured: 'structured information', | ||
additionalInformation: 'some additional information', | ||
}; | ||
|
||
it('properly combines remittance information', () => { | ||
expect( | ||
SskDusseldorfDussdeddxxx.normalizeTransaction( | ||
bookedTransactionOne, | ||
true, | ||
).remittanceInformationUnstructured, | ||
).toEqual('unstructured information some additional information'); | ||
|
||
expect( | ||
SskDusseldorfDussdeddxxx.normalizeTransaction( | ||
bookedTransactionTwo, | ||
true, | ||
).remittanceInformationUnstructured, | ||
).toEqual('structured information some additional information'); | ||
}); | ||
|
||
it('prioritizes creditor names correctly', () => { | ||
expect( | ||
SskDusseldorfDussdeddxxx.normalizeTransaction( | ||
bookedTransactionOne, | ||
true, | ||
).payeeName, | ||
).toEqual('A Useful Creditor Name'); | ||
|
||
expect( | ||
SskDusseldorfDussdeddxxx.normalizeTransaction( | ||
bookedTransactionTwo, | ||
true, | ||
).payeeName, | ||
).toEqual('Ultimate Creditor'); | ||
}); | ||
|
||
const unbookedTransaction = { | ||
transactionId: '2024102900000000-1', | ||
valueDate: '2024-10-29', | ||
transactionAmount: { | ||
amount: '-99.99', | ||
currency: 'EUR', | ||
}, | ||
creditorName: 'some nonsensical creditor', | ||
remittanceInformationUnstructured: 'some nonsensical information', | ||
}; | ||
|
||
it('returns null for unbooked transactions', () => { | ||
expect( | ||
SskDusseldorfDussdeddxxx.normalizeTransaction( | ||
unbookedTransaction, | ||
false, | ||
), | ||
).toBeNull(); | ||
|
||
expect(consoleSpy).toHaveBeenCalledWith( | ||
'Skipping unbooked transaction:', | ||
unbookedTransaction.transactionId, | ||
); | ||
}); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
category: Maintenance | ||
authors: [MikesGlitch] | ||
--- | ||
|
||
Updating readme regarding the consolidation of the Actual-Server and Actual repos |
Oops, something went wrong.