blob: fa5ae918a74f474b17496996b9e597054f5f5020 [file] [log] [blame]
Akronccd9d7d2020-09-22 09:51:19 +02001use Mojo::Base -strict;
2use Test::More;
3use Test::Mojo;
4use Mojo::File qw/tempfile/;
5
6# Test the documentation
7my $t = Test::Mojo->new('Kalamar');
8
9my $temp = tempfile();
10
11$temp->spurt(<<SCRIPT);
12[{
13 'name' : 'Export',
14 'desc' : 'Exports Kalamar results',
15 'embed' : [{
16 'panel' : 'result',
17 'title' : 'exports KWICs and snippets',
18 'icon' : "\uf019",
19 'classes' : ['button-icon','plugin'],
20 'onClick' : {
21 'action' : 'addWidget',
22 'template' : 'http://localhost:7777/res/export.html'
23 }
24 }]
25}]
26SCRIPT
27
28$t->app->plugin('Plugins' => {
29 default_plugins => $temp->to_string
30});
31
32$t->get_ok('/')
33 ->text_is('h1 span', 'KorAP - Corpus Analysis Platform')
34 ->content_like(qr!KorAP\.Plugins\s*=\s*\[!)
35 ->content_like(qr!<script>\/\/<\!\[CDATA\[!)
36 ;
37
38done_testing;