-
-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create test for templateManager #1515
Create test for templateManager #1515
Conversation
I'm trying to mock the
do you have any idea why @VincentLanglet or @Daric971 Edit 1: and It leads to other question, is this |
I know nothing about this service :/ |
e4fe5b3
to
d3b6589
Compare
d3b6589
to
eca8e4c
Compare
34af942
to
a9eae36
Compare
Finally I could cover |
Could you check this PR @VincentLanglet @jordisala1991 , please :) |
src/Resources/views/layout.html.twig
Outdated
@@ -13,12 +13,12 @@ file that was distributed with this source code. | |||
{% block sonata_page_container %} | |||
<div class="container"> | |||
<div class="content"> | |||
<div class="row page-header"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we put id often ; so I dont like adding some for test, and would prefer something else than
static::assertCount(1, $crawler->filter('#header'));
Not sure what's sonata_page_render_container is doing but you might find somehting to search
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But in this case I'm testing the page, and I'm checking if there is an element into the page!
I guess it is fine to test elements into the page using "id", don't you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
breadcrumb, header, content, ... are way too generic words. What if someone use js on it ? What if he's already is using those ?
Adding id, it just a risk of BC-break with no benefit for the code. It's not like we're using js on something.
You're adding them because you're writting tests. And you should never have your test pushing you to modify your src code.
You can work on the already existing classes. Adding page-breadcrumb
class and so on might be a feature to allow overriding the design for user ; it seems better than ids.
But I don't understand the purpose of your test, checking for div in the page ; Checking for url, 200, etc might be enough.
@jordisala1991 wrote a lot of tests on 4.x branch and never needed to add id, or to find some div.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I want to make sure is if the breadcrumbs
are rendered into the page!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
page-breadcrumb
Ok I'll try to use page-breadcrumb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @VincentLanglet could you check again please!
I just let the testing checking breadcrumb
only, and I'm following the same way from page-header
a9eae36
to
baced94
Compare
baced94
to
dc54cb7
Compare
Hey @jordisala1991 could you review this PR please. and if it's possible merge into 4.x, tomorrow I would try to investigate the problem related with #1497 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO this test would be much more easy on 4.x with the tests i have already added for render pages.
Can you open a PR of the merge of 3.x into 4.x @eerison ? There is a lot of issue with this test when I try to merge |
Yeah, tomorrow I can do this :) |
Cover templateManager
I am targeting this branch, because in 4.x the page content is not rendered, and I need to understand first how it was working, something was changed or removed in 4.x that I can't identify.
Issue #1497