- Issue created by @jessebaker
- Assigned to jessebaker
- πΊπΈUnited States hooroomoo
I am currently using the mocked data since it has nested components to implement the layers menu in β¨ Implement the updated insert menuΒ and layers panel Active . But once π Introduce an example set of representative SDC components; transition from "component list" to "component tree" Fixed is in and there is a way to have nested components on /node/1 then I don't care if MSW gets removed.
But as a side note, there are currently Cypress unit tests that use layout-default.json as a fixture (not MSW) so we need to make sure thats in sync. Wondering if there's a way that can check a hard-coded json file is still in sync data structure/schema-wise with what the Drupal endpoints for /api/layout returns. Or on a unit test run, if it's possible to generate a fixture based on the current data structure/schema of what /api/layout returns but maybe thats overkill for unit tests.
- πΊπΈUnited States bnjmnm Ann Arbor, MI
Wim Leers β credited bnjmnm β .
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Wondering if there's a way that can check a hard-coded json file is still in sync data structure/schema-wise with what the Drupal endpoints for /api/layout returns.
Very good point! Neither Jesse nor Ben mentioned this, so I don't think they remembered/realized that the unit tests were using the fixtures too π (Or perhaps it was an implementation detail to them, not sure.)
And yes, that is possible, that is literally what we added in π Create an Open API spec for the current mock HTTP responses Fixed π See
\Drupal\Tests\experience_builder\Unit\UiFixturesValidationTest
. - Issue was unassigned.
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
π Introduce an example set of representative SDC components; transition from "component list" to "component tree" Fixed is in, so @hooroomoo should not need this anymore.
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Looks like π [needs design] [RESEARCH] Previewed component tree for Content Creator does not match the result for Visitor Active broke the
pages
CI job, so now our builds look red, when really, all tests are passing π Increasing priority. - First commit to issue fork.
- Merge request !210#3467674: Remove MSW infrastucture + `pages` CI job β (Merged) created by utkarsh_33
- Assigned to wim leers
- Status changed to Needs review
3 months ago 11:16am 27 August 2024 Fixed the test failures.There are still some warnings in the CI but that's not related to the changes that i made, so marking it needs review.
Thanks!- Issue was unassigned.
- Status changed to Needs work
3 months ago 12:34pm 27 August 2024 - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Almost!
components.json
should be removed AFAICT, because it is unused. - Assigned to utkarsh_33
- Issue was unassigned.
- Status changed to Needs review
3 months ago 3:46am 28 August 2024 We cannot delete the components.json as PHP tests are using it, so added back the file.
- Assigned to utkarsh_33
- Status changed to Needs work
3 months ago 8:29am 28 August 2024 - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
We cannot delete the components.json as PHP tests are using it, so added back the file.
π This is clearly the wrong conclusion.
Walking you through it:
- nothing is using
components.json
. Hence it should be removed. I explained this above. - the only thing that failed is
UiFixturesValidationTest::testUiComponentsFixture()
, which is just making sure that this fixture complies withopenapi.yml
- β¦ so clearly, if
components.json
is gone, then that sole test method can be removed too
The difference with
layout-default.json
is that that file is actually used by a Cypress unit test. That's why we keep that file. And that's why continuing to test its conformance inUiFixturesValidationTest::testUiLayoutDefaultFixture()
makes sense too. - nothing is using
- Assigned to wim leers
- Status changed to Needs review
3 months ago 8:47am 28 August 2024 - Assigned to utkarsh_33
- Status changed to Needs work
3 months ago 8:53am 28 August 2024 - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
A simple search for
msw
in the codebase shows the incompleteness of this MR:package-lock.json
still containsmsw
- the scripts in
package.json
still allow using the mocks README.md
still contains instructions for how to use the mocks
- Assigned to wim leers
- Status changed to Needs review
3 months ago 8:58am 28 August 2024 - Assigned to balintbrews
- Status changed to RTBC
3 months ago 9:31am 28 August 2024 - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
I think this is ready, but needs final sign-off from a
/ui
owner π - First commit to issue fork.
- Issue was unassigned.
- Status changed to Fixed
3 months ago 12:49pm 30 August 2024 -
Wim Leers β
committed f5d5b244 on 0.x authored by
utkarsh_33 β
Issue #3467674 by utkarsh_33, balintbrews, Wim Leers, jessebaker, bnjmnm...
-
Wim Leers β
committed f5d5b244 on 0.x authored by
utkarsh_33 β
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
I realise I'm in the minority, but I still feel this is a mistake, we're going against best-practice in the FE world. Registering my thoughts for posterity. Hope I'm wrong.
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
@larowlan What is the mistake here in your opinion? Requiring a Drupal API server? Using server-side-generated forms? Something else?
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
Too heavy a reliance on e2e tests makes the test suite slow and brittle
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Thanks! Interesting. Didn't expect that response π (Especially because this MR didn't remove any tests.)
Well, the good news is @traviscarden is improving all aspects of this project's use of OpenAPI (see π Add TravisCarden to `CODEOWNERS` for OpenAPI Fixed ). So if anything, introducing functional JS or component tests tests that do not use the Drupal back end but fixtures instead will become easier, not harder.
In the current state of this project, I agree with @jessebaker's and @bnjmnm's assessment that it's the better choice to indeed only use the Drupal back end. When the UI and/or API get to a point of being more complete, I think it may make sense to reintroduce API response fixtures.
Automatically closed - issue fixed for 2 weeks with no activity.