From 3f07824db19206c16a14eefbc882fb39c8ee71b4 Mon Sep 17 00:00:00 2001 From: LinaKind Date: Thu, 12 Dec 2024 10:26:38 +0000 Subject: [PATCH] Add another regression test and consider remaining missing coverage https://github.com/elifesciences/issues/issues/9034 --- .../Converter/TeaserTermsBuilderTest.php | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/test/ViewModel/Converter/TeaserTermsBuilderTest.php b/test/ViewModel/Converter/TeaserTermsBuilderTest.php index 3eca8ccb..f4a5dbd2 100644 --- a/test/ViewModel/Converter/TeaserTermsBuilderTest.php +++ b/test/ViewModel/Converter/TeaserTermsBuilderTest.php @@ -16,11 +16,11 @@ final class TeaserTermsBuilderTest extends TestCase /** * @test */ - final public function it_builds_significance_terms_when_there_are_significance_terms() + final public function it_builds_significance_terms_when_there_are_significance_terms_and_no_strength_terms_are_available() { $builder = new TeaserTermsBuilder(); - $elifeAssessment = new ElifeAssessment(['Landmark'], null); + $elifeAssessment = new ElifeAssessment(['landmark'], null); $result = $builder->build($elifeAssessment); $expected = new TeaserTerms([new Term('Landmark')]); @@ -30,7 +30,7 @@ final public function it_builds_significance_terms_when_there_are_significance_t /** * @test */ - final public function it_does_not_build_significance_terms_when_none_are_available() + final public function it_does_not_build_significance_terms_when_there_are_none_in_the_assessment_and_no_strength_terms_are_available() { $builder = new TeaserTermsBuilder(); @@ -43,23 +43,21 @@ final public function it_does_not_build_significance_terms_when_none_are_availab /** * @test */ - final public function it_builds_strength_terms_when_there_are_strength_terms() + final public function it_builds_strength_terms_when_there_are_strength_terms_and_no_significance_terms_are_available() { - $this->markTestIncomplete('incomplete'); - } + $builder = new TeaserTermsBuilder(); - /** - * @test - */ - final public function it_does_not_build_strength_terms_when_none_are_available() - { - $this->markTestIncomplete('incomplete'); + $elifeAssessment = new ElifeAssessment(null, ['convincing']); + $result = $builder->build($elifeAssessment); + + $expected = new TeaserTerms([new Term('Convincing')]); + $this->assertEquals($expected, $result); } /** * @test */ - final public function it_capitalises_the_first_letter_of_the_term() + final public function it_builds_terms_using_both_strength_and_significance_terms() { $this->markTestIncomplete('incomplete'); }