diff --git a/composer.json b/composer.json index 88a6b03965046d3d3b106be1f4136c0d8970e873..8c55534e170a610af6634ef4662a24d528dbfcb7 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "drupal/changed_fields": "^3.2", "drupal/config_ignore": "^3.0", "drupal/config_readonly": "^1.0", - "drupal/core": "^9.5", + "drupal/core": "9.5.5", "drupal/core-composer-scaffold": "^9.5", "drupal/custom_markup_block": "^1.1", "drupal/default_content": "^2.0", @@ -276,8 +276,9 @@ "Make it easier to trigger a tour @see https://www.drupal.org/project/drupal/issues/3012027": "https://www.drupal.org/files/issues/2022-01-17/3012027-52-9.3.x.patch", "EntityConstraintValidationList::findByCode is inconsistent @see https://www.drupal.org/project/drupal/issues/3126654": "https://www.drupal.org/files/issues/2020-04-10/find_by_code_override-3126654-D8-4.patch", "Cannot implement a custom user cancellation method @see https://www.drupal.org/project/drupal/issues/3135592": "https://git.drupalcode.org/project/drupal/-/merge_requests/1675.diff", - "preg_split in _filter_url breaks for long html tags @see https://www.drupal.org/project/drupal/issues/3239472": "resources/patch/drupal/core/3239472.diff", - "If you don't set the \"version\" of a profile, the report/status displays an empty dash @see https://www.drupal.org/project/drupal/issues/3270892": "https://git.drupalcode.org/project/drupal/-/merge_requests/2003.diff" + "If you don't set the \"version\" of a profile, the report/status displays an empty dash @see https://www.drupal.org/project/drupal/issues/3270892": "https://git.drupalcode.org/project/drupal/-/merge_requests/2003.diff", + "Restrict images to this site\" restricts images that, by definition, *are* on this site @see https://www.drupal.org/project/drupal/issues/2998318": "https://git.drupalcode.org/project/drupal/-/merge_requests/3810.diff", + "Have responsive image module ignore svg @see https://www.drupal.org/project/drupal/issues/2957924": "https://www.drupal.org/files/issues/2022-06-23/drupal-responsive_image_svg_support-2957924-11.patch" }, "drupal/default_content": { "Allow manual imports @see https://www.drupal.org/i/2640734": "https://git.drupalcode.org/project/default_content/-/merge_requests/20.diff" diff --git a/composer.lock b/composer.lock index 80d0f636ffdc0bf950a428738aa3d5cdbd60bc0a..71877fb08344beddbf03ccfff7d71014d903cafe 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "9e90c7584133bc36e8a7160afcca96ff", + "content-hash": "1ff58a00f06b18fcab4a3346bdfe897f", "packages": [ { "name": "asm89/stack-cors", diff --git a/tests/features/collection/collection.edit.feature b/tests/features/collection/collection.edit.feature index 70717c2bb81a57afba86a8111180c83cbd79e7e8..5fdfdc63da2ccebbec8b12e26e83bb7901209c7d 100644 --- a/tests/features/collection/collection.edit.feature +++ b/tests/features/collection/collection.edit.feature @@ -35,8 +35,7 @@ Feature: Editing collections And I press "Save as draft" Then I should see the heading "Überwaldean Sea Eels" - - @terms @javascript @uploadFiles:error.svg,simple.svg + @terms @javascript Scenario: Edit a collection wysiwyg modal should close. # Regression test for ticket ISAICP-7181. Given the following owner: @@ -59,19 +58,6 @@ Feature: Editing collections And I press "Save" in the "Modal buttons" region Then the modal should be closed - # Regression test for ticket ISAICP-7678. - When I press the button "Image" in the "Description" wysiwyg editor - Then a modal should open - When I fill in "Alternative text" with "Example SVG" - And I attach the file "error.svg" to "Image" - And I wait for AJAX to finish - Then I should see the error message "Invalid or unsafe SVG file." - And I attach the file "simple.svg" to "Image" - And I wait for AJAX to finish - Then I should not see the error message "Invalid or unsafe SVG file." - And I press "Save" in the "Modal buttons" region - Then the modal should be closed - @terms @javascript Scenario: Regression test wysiwyg add file shows a 0 bytes limit. # Regression test for ticket ISAICP-7177. diff --git a/tests/features/joinup_group/announcements.feature b/tests/features/joinup_group/announcements.feature index 10b7f47140c4a7b7f88eb58c998a4d27d4efeedb..29e151753f544777b51d3f19c78af5212df38e48 100644 --- a/tests/features/joinup_group/announcements.feature +++ b/tests/features/joinup_group/announcements.feature @@ -42,7 +42,7 @@ Feature: Messaging group announcements Then I should see the heading "Sign in to continue" When I go to the members page of "Fail pension" Then I should not see the link "Add announcement" - When I go to the homepage of the "Fail pension" collection + When I go to the homepage of the "Fail pension" <group> Then I should not see the link "Announcements" Given I am logged in as "Nice" @@ -52,14 +52,14 @@ Feature: Messaging group announcements Then the response status code should be 403 When I go to the members page of "Fail pension" Then I should not see the link "Add announcement" - When I go to the homepage of the "Fail pension" collection + When I go to the homepage of the "Fail pension" <group> Then I should not see the link "Announcements" Given I am logged in as "Sons of tweets" When I go to the announcements page of "Hidden gems" <group> Then the response status code should be 403 - When I go to the homepage of the "Hidden gems" collection + When I go to the homepage of the "Hidden gems" <group> Then I should not see the link "Announcements" # The 'Add announcement' button is also available from the members page. @@ -365,7 +365,7 @@ Feature: Messaging group announcements And I uncheck the box "Announcements enabled" And I press "Save" - When I go to the homepage of the "Fail pension" collection + When I go to the homepage of the "Fail pension" <group> # Moderators have an "Announcements" link also in the toolbar. Then I should not see the link "Announcements" in the "Entity actions" region When I go to the "The Big Opening is postponed" announcement of "Fail pension" <group> @@ -375,7 +375,7 @@ Feature: Messaging group announcements Given I am logged in as "Sons of tweets" - When I go to the homepage of the "Fail pension" collection + When I go to the homepage of the "Fail pension" <group> Then I should not see the link "Announcements" When I go to the "The Big Opening is postponed" announcement of "Fail pension" <group> Then the response status code should be 403 @@ -384,7 +384,7 @@ Feature: Messaging group announcements Given I am logged in as "Nice" - When I go to the homepage of the "Fail pension" collection + When I go to the homepage of the "Fail pension" <group> Then I should not see the link "Announcements" When I go to the "The Big Opening is postponed" announcement of "Fail pension" <group> Then the response status code should be 403 @@ -393,7 +393,7 @@ Feature: Messaging group announcements Given I am an anonymous user - When I go to the homepage of the "Fail pension" collection + When I go to the homepage of the "Fail pension" <group> Then I should not see the link "Announcements" When I go to the "The Big Opening is postponed" announcement of "Fail pension" <group> Then I should see the heading "Sign in to continue" diff --git a/tests/features/svg.feature b/tests/features/svg.feature new file mode 100644 index 0000000000000000000000000000000000000000..e492815d1a14d02f33f6760d67304fc65307fede --- /dev/null +++ b/tests/features/svg.feature @@ -0,0 +1,55 @@ +@api @group-f +Feature: Test SVG attachments. + + Background: + Given the following owner: + | name | type | + | SVG | Non-Profit Organisation | + And the following contact: + | name | SVG | + | email | svg@example.com | + And collections: + | title | logo | banner | abstract | description | content creation | moderation | topic | owner | contact information | state | + | SVG | logo.png | banner.jpg | Test | Test | facilitators and authors | yes | Supplier exchange | SVG | SVG | validated | + + @terms @javascript @uploadFiles:error.svg,simple.svg + Scenario: Edit a collection wysiwyg modal should close. + When I am logged in as a facilitator of the "SVG" collection + And I go to the edit form of the "SVG" collection + + And I press the button "Image" in the "Description" wysiwyg editor + Then a modal should open + When I fill in "Alternative text" with "Example SVG" + And I attach the file "error.svg" to "Image" + And I wait for AJAX to finish + Then I should see the error message "Invalid or unsafe SVG file." + And I attach the file "simple.svg" to "Image" + And I wait for AJAX to finish + Then I should not see the error message "Invalid or unsafe SVG file." + And I press "Save" in the "Modal buttons" region + Then the modal should be closed + + # Ensure local svg files are allowed. + And I press "Publish" + And I click "About" + And the response should not contain "This image has been removed. For security reasons, only images from the local domain are allowed." + And the response should contain "inline-images/simple" + + @terms @uploadFiles:error.svg,simple.svg + Scenario: SVG logos appear in the tiles. + When I am logged in as a facilitator of the "SVG" collection + And I go to the homepage of the "SVG" collection + And I click "Add news" in the plus button menu + When I fill in the following: + | Short title | SVG News | + | Headline | SVG News| + | Content | SVG News | + And I select "EU and European Policies" from "Topic" + + And I attach the file "simple.svg" to "Logo" + And I press "Upload" + And I press "Publish" + Then I should see the heading "SVG News" + + When I go to the homepage of the "SVG" collection + Then I should see the image "simple.svg" diff --git a/tests/src/Context/CollectionContext.php b/tests/src/Context/CollectionContext.php index fa0d5aeb67552b9adc276f9eea637a2f5c589880..8f8fb9259005c2ae109cc7a39d8ef54e7cac43c7 100644 --- a/tests/src/Context/CollectionContext.php +++ b/tests/src/Context/CollectionContext.php @@ -103,7 +103,7 @@ public function visitProposeCollectionForm(): void { */ public function visitCollection(string $collection): void { /** @var \Drupal\rdf_entity\Entity\Rdf $entity */ - $entity = $this->getEntityByLabel('rdf_entity', $collection); + $entity = $this->getEntityByLabel('rdf_entity', $collection, 'collection'); $this->visitPath($entity->toUrl()->toString()); }