<commit_before>=head1 NAME

t/integration/feature_gene.t - integration tests for gene feature URLs

=head1 DESCRIPTION

Tests for gene feature URLs

=head1 AUTHORS

Jonathan "Duke" Leto

=cut

use strict;
use warnings;
use Test::More;
use lib 't/lib';
use SGN::Test::Data qw/ create_test /;
use SGN::Test::WWW::Mechanize;

my $mech = SGN::Test::WWW::Mechanize->new;

my $gene_cvterm     = create_test('Cv::Cvterm', { name  => 'gene' });
my $gene_feature    = create_test('Sequence::Feature', { type => $gene_cvterm });
my $gene_featureloc = create_test('Sequence::Featureloc', { feature => $gene_feature });

$mech->get_ok("/feature/view/name/" . $gene_feature->name);
$mech->content_contains('Gene Data');
$mech->content_contains('Gene: ' . $gene_feature->name);
$mech->content_contains('Genomic Sequence');
$mech->content_contains('Related Features');

# This could be more stringent and use a CSS selector
$mech->content_contains('GBrowse');
$mech->content_contains('Not Available');

my ($name, $residues) = ($gene_feature->name, $gene_feature->residues);

like( $mech->findvalue( '/html/body//span[@class="sequence"]'), qr/>$name\s*$residues/, "Found >$name\\n$residues");
<commit_msg>fixed feature_gene.t integration tests<commit_after>=head1 NAME

t/integration/feature_gene.t - integration tests for gene feature URLs

=head1 DESCRIPTION

Tests for gene feature URLs

=head1 AUTHORS

<NAME>" Leto

=cut

use strict;
use warnings;
use Test::More;
use lib 't/lib';
use SGN::Test::Data qw/ create_test /;
use SGN::Test::WWW::Mechanize;

my $mech = SGN::Test::WWW::Mechanize->new;

my $gene_cvterm     = create_test('Cv::Cvterm', { name  => 'gene' });
my $gene_feature    = create_test('Sequence::Feature', { type => $gene_cvterm });
my $gene_featureloc = create_test('Sequence::Featureloc', { feature => $gene_feature });

$mech->get_ok("/feature/view/name/" . $gene_feature->name);
$mech->content_contains('Description');
$mech->content_contains('Gene ' . $gene_feature->name);
$mech->content_contains('Genomic sequence');
$mech->content_contains('Related features');

my $name = $gene_feature->name;

like( $mech->findvalue( '/html/body//span[@class="sequence"]'), qr/>$name\s*/, "Found >$name seq header");

{'fraction_non_alphanumeric': 0.18058690744920994, 'fraction_numerical': 0.002708803611738149, 'mean_word_length': 6.079872204472843, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 37, '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': '4911652', 'n_tokens_mistral': 810, 'n_tokens_neox': 762, 'n_words': 166}