Commit 2672fa00 authored by Christophe Maudoux's avatar Christophe Maudoux

Perltidy

parent ffef6ed6
...@@ -47,6 +47,7 @@ SKIP: { ...@@ -47,6 +47,7 @@ SKIP: {
), ),
'Form registration' 'Form registration'
); );
#expectRedirection( $res, qr#/2fregisters/totp$# ); #expectRedirection( $res, qr#/2fregisters/totp$# );
ok( ok(
$res = $client->_get( $res = $client->_get(
...@@ -119,7 +120,7 @@ SKIP: { ...@@ -119,7 +120,7 @@ SKIP: {
'Post code' 'Post code'
); );
$id = expectCookie($res); $id = expectCookie($res);
ok( ok(
$res = $client->_get( $res = $client->_get(
'/2fregisters', '/2fregisters',
...@@ -128,15 +129,31 @@ SKIP: { ...@@ -128,15 +129,31 @@ SKIP: {
), ),
'Form 2fregisters' 'Form 2fregisters'
); );
ok( $res->[2]->[0] =~ /2fregistration\.(?:min\.)?js/, 'Found 2f registration js' ); ok( $res->[2]->[0] =~ /2fregistration\.(?:min\.)?js/,
'Found 2f registration js' );
ok( $res->[2]->[0] =~ qr%<img src="/static/bootstrap/totp.png" alt="totp2F" title="totp2F" />%, 'Found totp.png' ) or print STDERR Dumper($res->[2]->[0]);
ok( $res->[2]->[0] =~ qr%<img src="/static/bootstrap/u2f.png" alt="u2F" title="u2F" />%, 'Found u2f.png' ) or print STDERR Dumper($res->[2]->[0]); ok(
ok( $res->[2]->[0] =~ qr%<a href="/2fregisters/u" class="nodecor">%, 'Found 2fregisters/u link' ) or print STDERR Dumper($res->[2]->[0]); $res->[2]->[0] =~
ok( $res->[2]->[0] =~ qr%<a href="/2fregisters/totp" class="nodecor">%, 'Found 2fregisters/totp link' ) or print STDERR Dumper($res->[2]->[0]); qr%<img src="/static/bootstrap/totp.png" alt="totp2F" title="totp2F" />%,
ok ($res->[2]->[0] =~ qr%<td class="align-middle" >TOTP</td><td class="align-middle">(\d{10})</td><td class="data-epoch">\d{10}</td>%, "TOTP epoch $1 found") 'Found totp.png'
or print STDERR Dumper($res->[2]->[0]); ) or print STDERR Dumper( $res->[2]->[0] );
ok(
$res->[2]->[0] =~
qr%<img src="/static/bootstrap/u2f.png" alt="u2F" title="u2F" />%,
'Found u2f.png'
) or print STDERR Dumper( $res->[2]->[0] );
ok( $res->[2]->[0] =~ qr%<a href="/2fregisters/u" class="nodecor">%,
'Found 2fregisters/u link' )
or print STDERR Dumper( $res->[2]->[0] );
ok( $res->[2]->[0] =~ qr%<a href="/2fregisters/totp" class="nodecor">%,
'Found 2fregisters/totp link' )
or print STDERR Dumper( $res->[2]->[0] );
ok(
$res->[2]->[0] =~
qr%<td class="align-middle" >TOTP</td><td class="align-middle">(\d{10})</td><td class="data-epoch">\d{10}</td>%,
"TOTP epoch $1 found"
) or print STDERR Dumper( $res->[2]->[0] );
ok( ok(
$res = $client->_post( $res = $client->_post(
'/2fregisters/totp/delete', '/2fregisters/totp/delete',
...@@ -146,7 +163,7 @@ SKIP: { ...@@ -146,7 +163,7 @@ SKIP: {
), ),
'Delete TOTP query' 'Delete TOTP query'
); );
ok( ok(
$res = $client->_get( $res = $client->_get(
'/2fregisters', '/2fregisters',
...@@ -155,13 +172,21 @@ SKIP: { ...@@ -155,13 +172,21 @@ SKIP: {
), ),
'Form 2fregisters' 'Form 2fregisters'
); );
ok( $res->[2]->[0] =~ /2fregistration\.(?:min\.)?js/, 'Found 2f registration js' ); ok( $res->[2]->[0] =~ /2fregistration\.(?:min\.)?js/,
ok( $res->[2]->[0] =~ qr%<a href="/2fregisters/u" class="nodecor">%, 'Found 2fregisters/u link' ) or print STDERR Dumper($res); 'Found 2f registration js' );
ok( $res->[2]->[0] =~ qr%<a href="/2fregisters/totp" class="nodecor">%, 'Found 2fregisters/totp link' ) or print STDERR Dumper($res); ok( $res->[2]->[0] =~ qr%<a href="/2fregisters/u" class="nodecor">%,
ok ($res->[2]->[0] !~ qr%<td class="align-middle" >TOTP</td><td class="align-middle">(\d{10})</td><td class="data-epoch">\d{10}</td>%, "TOTP deleted") 'Found 2fregisters/u link' )
or print STDERR Dumper($res->[2]->[0]); or print STDERR Dumper($res);
ok( $res->[2]->[0] =~ qr%<a href="/2fregisters/totp" class="nodecor">%,
'Found 2fregisters/totp link' )
or print STDERR Dumper($res);
ok(
$res->[2]->[0] !~
qr%<td class="align-middle" >TOTP</td><td class="align-middle">(\d{10})</td><td class="data-epoch">\d{10}</td>%,
"TOTP deleted"
) or print STDERR Dumper( $res->[2]->[0] );
$client->logout($id); $client->logout($id);
} }
count($maintests); count($maintests);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment