| use Mojo::File qw/tempfile/; |
| my $t = Test::Mojo->new('Kalamar'); |
| "desc" : "Exports Kalamar results", |
| "title" : "exports KWICs and snippets", |
| "classes" : ["button-icon","plugin"], |
| "template" : "http://localhost:7777/res/export.html" |
| $t->app->plugin('Plugins' => { |
| default_plugins => $temp->to_string |
| ->text_is('h1 span', 'KorAP - Corpus Analysis Platform') |
| ->content_unlike(qr!KorAP\.Plugins\s*=\s*\[!) |
| ->content_unlike(qr!<script>\/\/<\!\[CDATA\[!) |
| ->content_like(qr!<span id="kalamar-plugins" data-plugins="/settings/plugin/list\.json"></span>!) |
| $t->get_ok('/settings/plugin/list.json') |
| ->header_is('Content-Type','application/json;charset=UTF-8') |
| ->content_unlike(qr!KorAP\.Plugins=!) |
| ->content_like(qr!button-icon!) |
| ->json_is('/0/embed/0/title','exports KWICs and snippets') |