Closed (fixed)
Project:
Menu Multilingual
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
3 Mar 2019 at 15:09 UTC
Updated:
27 Sep 2023 at 12:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #3
matsbla commentedCommitted first tests for custom menu items.
Still need tests for view links, and integration with Menu block and Context.
Comment #4
jeroentStarted working on a menu_block test.
Comment #5
jeroentComment #6
jeroentAdded composer.json file to add menu_block module.
Comment #7
jeroentComment #8
jeroentThe tests are running now, but I still get the following error when running the tests:
Comment #9
jeroentError "block.block.mainnavigation:settings.expand missing schema" is fixed in 8.x-1.x branch of menu_block module. But when using this branch, there are a couple of other issues which are solved here: https://www.drupal.org/project/menu_block/issues/3022011.
There is still a missing schema for block.block.mainnavigation:settings.only_translated_labels and block.block.mainnavigation:settings.only_translated_content.
Comment #10
matsbla commentedI think the Menu Block tests should be the same as the base tests, as it should pass all the same tests, so we can simply extend the base test and add Menu Block to the module dependencies.
Comment #11
matsbla commentedComment #12
jeroent@matsbla,
In your patch, the menu_block module is enabled, but the main navigation is still a system_menu_block. Tests will probably pass because the menu_block module is not used.
In my patch, I moved all the helper functions to a base test class. I also added a composer.json file because the testbot has no idea where he has to download the menu_block module without it.
Comment #13
matsbla commentedOkay, you are right. I tested more. In the setup I tried to assert that we are using menu_block when adding new manu blocks. It seems like the form is correct. However when saving the block it is returned a status code 500, I tested more, but I'm not sure why this happens.
Comment #14
matsbla commentedComment #15
jeroentLets check with strict config schema disabled.
Comment #16
jeroentComment #17
jeroentSo the problem is the schema. Let's see if I can find something.
Comment #18
matsbla commentedOkay! Maybe we could commit it with strictConfigSchema set to false for now, to get a test, and remove it in a follow-up once the schemas in menu_block is fixed.
I reworked the patch a little, I think it will be easier to maintain the tests if we keep them in 1 place, let me know what you think.
Thanks for helping with the tests!
Comment #19
matsbla commentedFor to add the composer.json file
Comment #20
matsbla commentedComment #21
matsbla commentedComment #22
jeroent@matsbla,
Code looks good!
Only thing I would change is in every drupalPostForm the label should not be translated. Klausi mentioned this once to me in #3024558-41: Username regenerated improperly after rc6 release.5
Comment #23
matsbla commentedOkay so removing string translations from tests
Comment #25
matsbla commentedCreated a follow up #3039094: Make Menu Block tests use strict config schema
We are still missing tests for Context integration and views links
Comment #26
matsbla commentedTests for views menu links
Comment #28
jeroentComment #29
jeroentComment #30
matsbla commentedComment #31
matsbla commentedComment #32
jeroentComment #33
jeroentThe patch I wrote depends on #3228412: Replace deprecated code in tests so we should probably wait until that gets committed.
Comment #34
jeroentAlso, it would be great to have tests are scheduled for "Run on commit and for issues" so tests also run for merge requests.
Comment #35
matsbla commentedThanks for the effort!
Have scheduled tests for "Run on commit and for issues" as you suggested, thank you.
Comment #36
matsbla commentedReroll patch for context integration
Comment #37
matsbla commentedComment #38
matsbla commentedComment #39
matsbla commentedComment #40
matsbla commentedComment #41
matsbla commentedComment #42
matsbla commentedLasts tests for context module added in #2956990: Settings no longer stored as third party settings