Skip to content

Commit b87db73

Browse files
committed
impoving tests
1 parent cf4a0d5 commit b87db73

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

tests/Unit/StaticBuilderTest.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,27 @@
1717
$this->app = $app;
1818
});
1919

20-
test('StaticBuilder builds paginated index page', function () {
20+
test('StaticBuilder builds paginated index page with content listing', function () {
2121
/** @var StaticBuilder $builder */
2222
$builder = $this->app->builder;
2323
$builder->buildPaginatedIndex();
2424
expect(is_file($builder->outputPath . '/index.html'))->toBeTrue()
2525
->and(is_dir($builder->outputPath . '/page'))->toBeTrue();
26+
27+
$content = file_get_contents($builder->outputPath . '/index.html');
28+
expect($content)->toMatch("/template listing/");
2629
});
2730

28-
test('StaticBuilder builds paginated content types pages', function () {
31+
test('StaticBuilder builds paginated content types pages and single pages', function () {
2932
/** @var StaticBuilder $builder */
3033
$builder = $this->app->builder;
3134
$builder->buildContentType('posts');
3235
expect(is_file($builder->outputPath . '/posts/index.html'))->toBeTrue()
3336
->and(is_file($builder->outputPath . '/posts/test0/index.html'))->toBeTrue()
3437
->and(is_dir($builder->outputPath . '/posts/page'))->toBeTrue();
38+
39+
$content = file_get_contents($builder->outputPath . '/posts/test0/index.html');
40+
expect($content)->toMatch("/template single/");
3541
});
3642

3743
test('StaticBuilder builds custom index page', function () {
@@ -64,3 +70,4 @@
6470
$builder->cleanUp();
6571
expect(is_file($builder->outputPath . '/index.html'))->toBeFalse();
6672
});
73+

0 commit comments

Comments
 (0)