Bugzilla – Attachment 165629 Details for
Bug 35628
Add optional statuses to catalog concerns
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35628: Unit tests for addition to tickets API
Bug-35628-Unit-tests-for-addition-to-tickets-API.patch (text/plain), 2.62 KB, created by
Martin Renvoize (ashimema)
on 2024-04-26 09:37:02 UTC
(
hide
)
Description:
Bug 35628: Unit tests for addition to tickets API
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-04-26 09:37:02 UTC
Size:
2.62 KB
patch
obsolete
>From 0e02f8ecc338d5f41f73a6b0a00c4ff34403e089 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 25 Apr 2024 16:10:24 +0100 >Subject: [PATCH] Bug 35628: Unit tests for addition to tickets API > >This patch updates the unit test for the ticket_updates api to catch >both the missing test 'state' for the existing state change >functionality and also the new 'status' functionality introduced with >this patchset. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/db_dependent/api/v1/ticket_updates.t | 25 +++++++++++++++++++++++-- > 1 file changed, 23 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/api/v1/ticket_updates.t b/t/db_dependent/api/v1/ticket_updates.t >index 93e8d6968e3..7349c2761e8 100755 >--- a/t/db_dependent/api/v1/ticket_updates.t >+++ b/t/db_dependent/api/v1/ticket_updates.t >@@ -118,7 +118,7 @@ subtest 'list_updates() tests' => sub { > > subtest 'add_update() tests' => sub { > >- plan tests => 34; >+ plan tests => 37; > > $schema->storage->txn_begin; > >@@ -145,7 +145,12 @@ subtest 'add_update() tests' => sub { > my $ticket = $builder->build_object( > { > class => 'Koha::Tickets', >- value => { reporter_id => $patron->id } >+ value => { >+ reporter_id => $patron->id, >+ resolver_id => undef, >+ resolved_date => undef, >+ status => 'new' >+ } > } > ); > my $ticket_id = $ticket->id; >@@ -233,7 +238,9 @@ subtest 'add_update() tests' => sub { > ); > $THE_notice->delete; > >+ # Check that state change triggers correct notice > $update->{state} = 'resolved'; >+ $update->{status} = 'TEST'; > $update_id = > $t->post_ok( > "//$userid:$password@/api/v1/tickets/$ticket_id/updates" => json => >@@ -253,5 +260,19 @@ subtest 'add_update() tests' => sub { > 'Notice queued was a TICKET_RESOLVED for status changing update' > ); > >+ # Check that state change is carried over to ticket >+ $ticket = $ticket->get_from_storage; >+ is( >+ $ticket->resolver_id, $librarian->id, >+ "Ticket was given resolver_id matching the librarian id of the update when state was changed to 'resolved'" >+ ); >+ isnt( $ticket->resolved_date, undef, "Ticket was given resolved_date when state was updated to 'resolved'" ); >+ >+ # Check that status change is carried over to ticket >+ is( >+ $ticket->status, 'TEST', >+ "Ticket status was updated in line with status change in update" >+ ); >+ > $schema->storage->txn_rollback; > }; >-- >2.44.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35628
:
160255
|
160256
|
160257
|
160258
|
160259
|
160268
|
160269
|
160270
|
160271
|
160272
|
160273
|
160274
|
160286
|
160287
|
160288
|
160289
|
160290
|
160308
|
160309
|
160310
|
160311
|
160312
|
160313
|
160314
|
160315
|
160316
|
160317
|
160318
|
160319
|
160320
|
160329
|
160330
|
160331
|
160332
|
160333
|
160334
|
160335
|
160364
|
162500
|
164912
|
164913
|
164914
|
164915
|
164916
|
164917
|
164918
|
165551
|
165552
|
165553
|
165554
|
165555
|
165556
|
165557
|
165560
|
165561
|
165562
|
165563
|
165564
|
165599
|
165600
|
165601
|
165602
|
165603
|
165604
|
165605
|
165606
|
165607
|
165608
|
165622
|
165623
|
165624
|
165625
|
165626
|
165627
|
165628
|
165629
|
165630
|
165631
|
165770
|
165771
|
165772
|
165773
|
165774
|
165775
|
165776
|
165777
|
165778
|
165779