<commit_before>#!/usr/bin/perl -w

use saliweb::Test;
use Test::More 'no_plan';

BEGIN {
    use_ok('ligscore');
}

my $t = new saliweb::Test('ligscore');

# Test get_navigation_links
{
    my $self = $t->make_frontend();
    my $links = $self->get_navigation_links();
    isa_ok($links, 'ARRAY', 'navigation links');
    like($links->[0],
         qr#<a href="http://modbase/top/help.cgi\?type=about">About</a>#,
         'About link');
    like($links->[1],
         '/<a href="http:\/\/modbase\/top\/">Web Server<\/a>/', 'Index link');
}

# Test get_lab_navigation_links
{
    my $self = $t->make_frontend();
    my $links = $self->get_lab_navigation_links();
    isa_ok($links, 'ARRAY', 'lab navigation links');
    like($links->[0],
         qr#<a href="http.*">Sali Lab Home</a>#, 'Lab link');
    like($links->[9],
         '/<a href="http:\/\/shoichetlab.*">Shoichet Lab<\/a>/',
         'Shoichet link');
}

# Test get_project_menu
{
    my $self = $t->make_frontend();
    my $menu = $self->get_project_menu();
    is($menu, "", "Project menu");
}

# Test get_header_page_title
{
    my $self = $t->make_frontend();
    my $header = $self->get_header_page_title();
    like($header, qr#a web server for scoring#, "header page title");
}

# Test get_footer
{
    my $self = $t->make_frontend();
    my $footer = $self->get_footer();
    like($footer, qr#Statistical Potential for Modeling#, "footer");
}

# Test get_index_page
{
    my $self = $t->make_frontend();
    my $txt = $self->get_index_page();
    like($txt, '/Email address.*Score type/ms',<commit_msg>Fix test for Sali Lab home URL.<commit_after>#!/usr/bin/perl -w

use saliweb::Test;
use Test::More 'no_plan';

BEGIN {
    use_ok('ligscore');
}

my $t = new saliweb::Test('ligscore');

# Test get_navigation_links
{
    my $self = $t->make_frontend();
    my $links = $self->get_navigation_links();
    isa_ok($links, 'ARRAY', 'navigation links');
    like($links->[0],
         qr#<a href="http://modbase/top/help.cgi\?type=about">About</a>#,
         'About link');
    like($links->[1],
         '/<a href="http:\/\/modbase\/top\/">Web Server<\/a>/', 'Index link');
}

# Test get_lab_navigation_links
{
    my $self = $t->make_frontend();
    my $links = $self->get_lab_navigation_links();
    isa_ok($links, 'ARRAY', 'lab navigation links');
    like($links->[0],
         qr#<a href="//salilab\.org.*">Sali Lab Home</a>#, 'Lab link');
    like($links->[9],
         '/<a href="http:\/\/shoichetlab.*">Shoichet Lab<\/a>/',
         'Shoichet link');
}

# Test get_project_menu
{
    my $self = $t->make_frontend();
    my $menu = $self->get_project_menu();
    is($menu, "", "Project menu");
}

# Test get_header_page_title
{
    my $self = $t->make_frontend();
    my $header = $self->get_header_page_title();
    like($header, qr#a web server for scoring#, "header page title");
}

# Test get_footer
{
    my $self = $t->make_frontend();
    my $footer = $self->get_footer();
    like($footer, qr#Statistical Potential for Modeling#, "footer");
}

# Test get_index_page
{
    my $self = $t->make_frontend();
    my $txt = $self->get_index_page();
    like($txt, '/Email address.*Score type/ms',
{'fraction_non_alphanumeric': 0.20775535939470366, 'fraction_numerical': 0.0025220680958385876, 'mean_word_length': 3.382596685082873, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1521029', 'n_tokens_mistral': 1196, 'n_tokens_neox': 1158, 'n_words': 237}