Append unit test (#1714)

This commit is contained in:
Christophe Maudoux 2022-02-13 18:07:17 +01:00
parent d6c689c1ec
commit 717eafdd2f
3 changed files with 47 additions and 1 deletions

View File

@ -795,6 +795,7 @@ t/79-2F-Yubikey.t
t/90-Translations.t
t/91-Handler-cache-cleaned.t
t/91-Memory-Leak.t
t/99-Bad-logLevel.t
t/99-Dont-load-Dumper.t
t/99-pod.t
t/AfterDataCustomPlugin.pm
@ -805,7 +806,6 @@ t/gpghome/openpgp-revocs.d/9482CEFB055809CBAFE6D71AAB2D5542891D1677.rev
t/gpghome/private-keys-v1.d/A076B0E7DB141A919271EE8B581CDFA8DA42F333.key
t/gpghome/private-keys-v1.d/B7219440BCCD85200121CFB89F94C8D98C0397B3.key
t/gpghome/pubring.kbx
t/gpghome/pubring.kbx~
t/gpghome/tofu.db
t/gpghome/trustdb.gpg
t/HistoryPlugin.pm

View File

@ -30,6 +30,16 @@ ok( $res->[2]->[0] =~ qq%<img src="/static/common/logos/logo_llng_400px.png"%,
ok( $res->[2]->[0] =~ m%<span id="languages"></span>%, 'Language icons found' )
or print STDERR Dumper( $res->[2]->[0] );
count(3);
ok(
$res = $client->_get(
'/logout',
accept => 'text/html'
),
'Get logout page'
);
ok( $res->[2]->[0] =~ m%<span trmsg="47">%, ' PE_LOGOUT_OK' )
or print STDERR Dumper( $res->[2]->[0] );
count(2);
clean_sessions();

View File

@ -0,0 +1,36 @@
use Test::More;
use strict;
use Data::Dumper;
require 't/test-lib.pm';
my $res;
my $client = LLNG::Manager::Test->new( {
ini => {
logLevel => 'error ',
useSafeJail => 1,
authentication => 'Null',
userDB => 'Same',
}
}
);
ok( $res = $client->_get('/'), 'Auth query' );
count(1);
expectOK($res);
my $id = expectCookie($res);
ok(
$res = $client->_get(
'/logout',
accept => 'text/html'
),
'Get logout page'
);
ok( $res->[2]->[0] =~ m%<span trmsg="47">%, ' PE_LOGOUT_OK' )
or print STDERR Dumper( $res->[2]->[0] );
count(2);
clean_sessions();
done_testing( count() );