blob: 53ab29e76d9984333bae22aa8901f2a7c8609a09 [file] [log] [blame]
Nils Diewald034ea702015-01-16 19:41:52 +00001use Mojo::Base -strict;
2use lib '../lib', 'lib';
Akron3042f242017-04-15 16:57:55 +02003use Test::More;
Nils Diewald034ea702015-01-16 19:41:52 +00004use Test::Mojo;
5
Akron3042f242017-04-15 16:57:55 +02006$ENV{MOJO_MODE} = 'test';
7
Nils Diewald2fe12e12015-03-06 16:47:06 +00008my $t = Test::Mojo->new('Kalamar');
Akron3042f242017-04-15 16:57:55 +02009
Nils Diewald034ea702015-01-16 19:41:52 +000010$t->get_ok('/')
11 ->status_is(200)
Nils Diewalda748b0e2015-05-19 22:54:06 +000012 ->text_is('title', 'KorAP - Corpus Analysis Platform')
13 ->text_like('h1 span', qr/KorAP - Corpus Analysis Platform/i)
Nils Diewald034ea702015-01-16 19:41:52 +000014 ;
15
16# Check paging
Akron3042f242017-04-15 16:57:55 +020017$t->get_ok('/?q=Baum')
18 ->text_like('h1 span', qr/KorAP: Find .Baum./i)
Nils Diewalda748b0e2015-05-19 22:54:06 +000019 # ->text_is('pre.query.serial span', 'JSON-LD Serialization for "test"')
20 ->text_like('#total-results', qr/\d+$/)
Nils Diewald034ea702015-01-16 19:41:52 +000021 ->text_is('#pagination a[rel=self] span', 1)
Akron3042f242017-04-15 16:57:55 +020022 ;
23
24done_testing;
25__END__
Nils Diewald034ea702015-01-16 19:41:52 +000026
27# Check paging
28$t->get_ok('/?q=test&p=2')
Nils Diewalda748b0e2015-05-19 22:54:06 +000029 # ->text_is('pre.query.serial span', 'JSON-LD Serialization for "test"')
30 ->text_like('#total-results', qr/\d+$/)
Nils Diewald034ea702015-01-16 19:41:52 +000031 ->text_is('#pagination a[rel=self] span', 2)
32;
33
Nils Diewalda748b0e2015-05-19 22:54:06 +000034done_testing;
35__END__