Bug 12278: Add unit tests

Signed-off-by: Coleen Lilly <clilly@aacpl.net>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Sponsored-by: Anne Arundel County Public Library <https://www.aacpl.net/>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
Matt Blenkinsop 2026-06-11 16:39:39 +01:00 committed by Pedro Amorim
parent b114eb709f
commit f7bbdd4976
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
1 changed files with 12 additions and 0 deletions

View File

@ -186,6 +186,18 @@ is( $invoices[1]->{invoicenumber}, 'invoice2', 'GetInvoices() to search by only
is( scalar @invoices, 1, 'GetInvoices() to filter by closedate' );
is( $invoices[0]->{invoicenumber}, 'invoice_close', 'GetInvoices() to filter by closedate' );
subtest 'GetInvoices() returns financial totals' => sub {
plan tests => 4;
my @inv = GetInvoices( invoicenumber => 'invoice2' );
my $inv2 = $inv[0];
ok( exists $inv2->{total_tax_excluded}, 'GetInvoices returns total_tax_excluded' );
ok( exists $inv2->{total_tax_included}, 'GetInvoices returns total_tax_included' );
ok( exists $inv2->{total_adj}, 'GetInvoices returns total_adj' );
cmp_ok( $inv2->{total_tax_included}, '>=', 0, 'total_tax_included is non-negative' );
};
my $invoicesummary1 = GetInvoice($invoiceid1);
is( $invoicesummary1->{'invoicenumber'}, 'invoice1', 'GetInvoice retrieves correct invoice' );
is(