X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Ft%2Fweb%2Fticket_seen.t;h=3a77a5899efe1ad4e6bd18df6efe8e9a9626795a;hb=fc6209f398899f0211cfcedeb81a3cd65e04a941;hp=00b2632d8a02ebeaa0d3e2a41123cd1b0781583b;hpb=e70abd21bab68b23488f7ef1ee2e693a3b365691;p=freeside.git diff --git a/rt/t/web/ticket_seen.t b/rt/t/web/ticket_seen.t index 00b2632d8..3a77a5899 100644 --- a/rt/t/web/ticket_seen.t +++ b/rt/t/web/ticket_seen.t @@ -3,7 +3,7 @@ use strict; use warnings; -use RT::Test tests => 16; +use RT::Test tests => 21; my $queue = RT::Test->load_or_create_queue( Name => 'Regression' ); ok $queue && $queue->id, 'loaded or created queue'; @@ -52,6 +52,14 @@ diag "user B adds a message, we check that user A see notification and can clear my ($status, $msg) = $ticket->Correspond( Content => 'bla-bla' ); ok $status, 'added reply' or diag "error: $msg"; + my $txns = $ticket->Transactions; + $txns->Limit( + FIELD => 'Type', + VALUE => "Correspond", + ); + my $txn = $txns->Last; + my $reply_id = $txn->id; + ok( $reply_id, 'got correspond txn id' ); $agent_a->goto_ticket($tid); $agent_a->content_like(qr/bla-bla/ims, 'the message on the page'); @@ -61,11 +69,23 @@ diag "user B adds a message, we check that user A see notification and can clear 'we have not seen something' ); + $agent_a->follow_link_ok( + { text => 'jump to the first unread message' }, + 'try to jump to first unread message' + ); + like( $agent_a->base, qr/#txn-$reply_id$/, 'contains anchor' ); + $agent_a->follow_link_ok({text => 'jump to the first unread message and mark all messages as seen'}, 'try to mark all as seen'); $agent_a->content_like( qr/Marked all messages as seen/ims, 'see success message' ); + like( $agent_a->base, qr/#txn-$reply_id$/, 'contains anchor' ); + + $agent_a->content_like( + qr/Marked all messages as seen/ims, + 'see success message' + ); $agent_a->goto_ticket($tid); $agent_a->content_unlike( @@ -74,7 +94,3 @@ diag "user B adds a message, we check that user A see notification and can clear ); } - - - -