From b00517a1be79cb3ffa2b250a37766d47cd180e82 Mon Sep 17 00:00:00 2001 From: 22Alexandra Date: Wed, 16 Feb 2022 18:40:46 +0200 Subject: [PATCH] EWPP-1997: Update status message test. --- tests/src/Kernel/StatusMessagesTest.php | 41 ++++++++++++------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/tests/src/Kernel/StatusMessagesTest.php b/tests/src/Kernel/StatusMessagesTest.php index eda4f4655..b29bd5af3 100644 --- a/tests/src/Kernel/StatusMessagesTest.php +++ b/tests/src/Kernel/StatusMessagesTest.php @@ -73,12 +73,9 @@ public function testStatusMessages(array $data): void { $this->assertCount(1, $title, sprintf('Wrong number of headings found for "%s" messages.', $type)); $this->assertEquals($heading, trim($title->first()->text())); - $list_items = $wrapper->filter('p.ecl-message__description span'); - $this->assertSameSize($messages, $list_items, sprintf('Wrong number of "%s" messages found.', $type)); - - foreach ($messages as $delta => $message) { - $this->assertEquals($message, trim($list_items->eq($delta)->text())); - } + $description = $wrapper->filter('div.ecl-message__description'); + $this->assertCount(1, $description, sprintf('Wrong number of "%s" messages found.', $type)); + $this->assertEquals(implode($messages), trim($description->text())); } // Verify that no message types other than the ones present in the test data @@ -124,8 +121,8 @@ public function statusMessagesProvider(): array { [ [ MessengerInterface::TYPE_STATUS => [ - 'Status message 1.', - 'Status message 2.', + '

Status message 1.


', + 'Status message 2.', ], ], ], @@ -133,7 +130,7 @@ public function statusMessagesProvider(): array { [ [ MessengerInterface::TYPE_WARNING => [ - 'Warning message 1.', + '
Warning message 1.
', ], ], ], @@ -141,8 +138,8 @@ public function statusMessagesProvider(): array { [ [ MessengerInterface::TYPE_WARNING => [ - 'Warning message 1.', - 'Warning message 2.', + '

Warning message 1.


', + 'Warning message 2.
', 'Warning message 3.', ], ], @@ -159,9 +156,9 @@ public function statusMessagesProvider(): array { [ [ MessengerInterface::TYPE_ERROR => [ - 'Error message 1.', - 'Error message 2.', - 'Error message 3.', + '

Error message 1.


', + '

Error message 2.


', + 'Error message 3.
', 'Error message 4.', ], ], @@ -170,10 +167,10 @@ public function statusMessagesProvider(): array { [ [ MessengerInterface::TYPE_STATUS => [ - 'Status message 1.', + '

Status message 1.


', ], MessengerInterface::TYPE_WARNING => [ - 'Warning message 1.', + '

Warning message 1.

', ], ], ], @@ -181,12 +178,12 @@ public function statusMessagesProvider(): array { [ [ MessengerInterface::TYPE_ERROR => [ - 'Error message 1.', + 'Error message 1.
', 'Error message 2.', ], MessengerInterface::TYPE_WARNING => [ - 'Warning message 1.', - 'Warning message 2.', + 'Warning message 1.
', + 'Warning message 2.
', 'Warning message 3.', ], ], @@ -195,13 +192,13 @@ public function statusMessagesProvider(): array { [ [ MessengerInterface::TYPE_STATUS => [ - 'Status message 1.', + 'Status message 1.', ], MessengerInterface::TYPE_WARNING => [ - 'Warning message 1.', + 'Warning message 1.', ], MessengerInterface::TYPE_ERROR => [ - 'Error message 1.', + 'Error message 1.
', 'Error message 2.', ], ],