initial commit of file from CVS for smeserver-manager on Fri Mar 22 14:54:28 AEDT 2024
This commit is contained in:
19
root/usr/share/smanager/t/001_load.t
Normal file
19
root/usr/share/smanager/t/001_load.t
Normal file
@@ -0,0 +1,19 @@
|
||||
use Test::More;
|
||||
|
||||
plan skip_all => 'unset QUICK_TEST to enable this test' if $ENV{QUICK_TEST};
|
||||
|
||||
plan tests => 8;
|
||||
|
||||
use FindBin;
|
||||
use lib "$FindBin::Bin/../lib";
|
||||
|
||||
use_ok('SrvMngr');
|
||||
|
||||
# modules
|
||||
use_ok('Mojolicious');
|
||||
use_ok('Mojolicious::Plugin::I18N');
|
||||
use_ok('Mojolicious::Plugin::RenderFile');
|
||||
use_ok('Mojolicious::Plugin::CSRFDefender');
|
||||
use_ok('Net::Netmask');
|
||||
use_ok('DBM::Deep');
|
||||
use_ok('Mojo::JWT');
|
16
root/usr/share/smanager/t/002_basic.t
Normal file
16
root/usr/share/smanager/t/002_basic.t
Normal file
@@ -0,0 +1,16 @@
|
||||
use Mojo::Base -strict;
|
||||
|
||||
use Test::More;
|
||||
use Test::Mojo;
|
||||
|
||||
use FindBin;
|
||||
use lib "$FindBin::Bin/../lib";
|
||||
|
||||
eval "use esmith::ConfigDB";
|
||||
plan skip_all => 'esmith::ConfigDB (and others) required for testing 002_basic' if $@;
|
||||
|
||||
plan tests => 3;
|
||||
|
||||
|
||||
my $t = Test::Mojo->new('SrvMngr');
|
||||
$t->get_ok('/')->status_is(200)->content_like(qr/SME Server 10/);
|
33
root/usr/share/smanager/t/003_I18N.t
Normal file
33
root/usr/share/smanager/t/003_I18N.t
Normal file
@@ -0,0 +1,33 @@
|
||||
use Mojo::Base -strict;
|
||||
|
||||
use utf8;
|
||||
use Test::More;
|
||||
|
||||
plan skip_all => 'unset QUICK_TEST to enable this test' if $ENV{QUICK_TEST};
|
||||
|
||||
plan tests => 3;
|
||||
|
||||
use FindBin;
|
||||
use lib "$FindBin::Bin/../lib";
|
||||
|
||||
package main;
|
||||
use Mojolicious::Lite;
|
||||
|
||||
use Test::Mojo;
|
||||
|
||||
plugin 'SrvMngr::Plugin::I18N' => {
|
||||
namespace => 'SrvMngr::I18N::Modules::General', default => 'en'
|
||||
};
|
||||
|
||||
get '/' => 'index';
|
||||
|
||||
my $t = Test::Mojo->new;
|
||||
|
||||
$t->get_ok('/')->status_is(200)
|
||||
->content_is("Disabled en\n");
|
||||
|
||||
done_testing();
|
||||
|
||||
__DATA__
|
||||
@@ index.html.ep
|
||||
<%=l 'DISABLED' %> <%= languages %>
|
44
root/usr/share/smanager/t/004_panels.t
Normal file
44
root/usr/share/smanager/t/004_panels.t
Normal file
@@ -0,0 +1,44 @@
|
||||
use Mojo::Base -strict;
|
||||
|
||||
use Test::More;
|
||||
use Test::Mojo;
|
||||
|
||||
use FindBin;
|
||||
use lib "$FindBin::Bin/../lib";
|
||||
|
||||
eval "use esmith::ConfigDB";
|
||||
plan skip_all => 'esmith::ConfigDB (and others) required for testing 004_panels' if $@;
|
||||
|
||||
my $tests;
|
||||
plan tests => $tests;
|
||||
|
||||
BEGIN { $tests += 2 * 3 };
|
||||
|
||||
my $t = Test::Mojo->new('SrvMngr');
|
||||
$t->ua->max_redirects(1);
|
||||
|
||||
$t->get_ok('/')->status_is(200)->content_like(qr/SME Server 10/);
|
||||
$t->get_ok('/manual')->status_is(200)->content_like(qr/SME Server 10/);
|
||||
|
||||
BEGIN { $tests += 5 * 2 };
|
||||
my @panels = qw/ Initial Login Manual Support Request /;
|
||||
|
||||
for ( @panels ) {
|
||||
$t->get_ok("/$_")->status_is(200);
|
||||
}
|
||||
|
||||
BEGIN { $tests += 29 * 2 };
|
||||
@panels = qw/ Backup Bugreport Clamav Datetime
|
||||
Directory Domains Emailsettings Groups
|
||||
Hostentries Ibays Localnetworks Logout
|
||||
Modules Portforwarding Printers Proxy
|
||||
Pseudonyms Qmailanalog Quota Reboot
|
||||
Remoteaccess Review Support Swttheme
|
||||
Useraccounts Userpassword
|
||||
Viewlogfiles Workgroup Yum /;
|
||||
|
||||
for ( @panels ) {
|
||||
$t->get_ok("/$_")->status_is(200);
|
||||
}
|
||||
|
||||
##done_testing();
|
Reference in New Issue
Block a user