Skip to content

Commit

Permalink
Added a test case for xvs starting with a zero
Browse files Browse the repository at this point in the history
  • Loading branch information
tajnymag committed Jan 17, 2024
1 parent f7f82f7 commit 5ca0b62
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/spayd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ describe('spayd()', () => {
})).toBe('SPD*1.0*ACC:CZ5855000000001265098001+RZBCCZPP*ALT-ACC:CZ5855000000001265098001+RZBCCZPP,CZ5855000000001265098001*AM:480.55*CC:CZK*CRC32:B51BE0B4*DT:20180420*MSG:PAYMENT FOR SOME STUFF*PT:P2P*RF:1234567890123456*RN:PETR DVORAK*X-ID:1234567890*X-KS:1234567890*X-PER:7*X-VS:1234567890');
});

it('allows xvs starting with a zero', () => {
expect(spayd({
acc: 'CZ2806000000000168540115',
am: '450.00',
cc: 'CZK',
xvs: '0123456789'
})).toBe('SPD*1.0*ACC:CZ2806000000000168540115*AM:450.00*CC:CZK*X-VS:0123456789');
});

it('throws an exception when the amount is separated by comma', () => {
expect(() => spayd({
acc: 'CZ2806000000000168540115',
Expand Down

0 comments on commit 5ca0b62

Please sign in to comment.