blob: fc8c086a7bc9d3414ed26cd5724124c698965dab [file] [log] [blame]
Marc Kupietz08095ef2026-08-10 11:52:03 +02001use Mojo::Base -strict;
2use Test::More;
3use Test::Mojo;
4use Mojo::File qw/curfile/;
5
6my $t = Test::Mojo->new('Kalamar');
7push @{$t->app->renderer->paths}, curfile->dirname;
8
9my $c = $t->app->build_controller;
10
11# By default all three shipped parts are used; Kalamar ships no corpus, so
12# the corpus part is a placeholder.
13my $default = $c->include('partial/citation');
14like($default, qr/Under Construction/, 'corpus part is a placeholder by default');
15like($default, qr/KorAP architecture/, 'korap part is shipped');
16like($default, qr/MaltParser/, 'annotation part is shipped');
17
18# Each part can be replaced by an instance template.
19my $custom = $c->include('partial/citation',
20 corpus_citation => 'custom/partial/citation/corpus');
21like($custom, qr/The Example Corpus/, 'corpus part replaced by the instance template');
22unlike($custom, qr/Under Construction/, 'placeholder no longer rendered');
23like($custom, qr/KorAP architecture/, 'korap part still inherited');
24like($custom, qr/MaltParser/, 'annotation part still inherited');
25
26done_testing;