You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Surface topical event hint text and label from schema
We want to show a bit of hint text under the document type, which should come from the schema description, in the same way it does for other "single" document (sub)types such as news stories. The label should also come from the schema title. Topical events do not have subtypes so there is no additional choose type screen.
Calling `ConfigurableDocumentType.find` with a "real" document type key put us in a position where we needed to either build a test type with that key or stub the call. I opted to do the latter, since we have generally kept our tests agnostic to any real types.
I stubbed inside the test, in the "base" and "new document" controller tests, but opted for a test helper for the feature tests. This is because for unit tests we have a lot of granular scenarios where the "schema" needs to be built in place. Tests will break if I try to stub the `find` first with a generic document type instance. Nonetheless, for the feature tests, because all of them use the same json fixture, we can set up the document types and stub our find method for all tests. There are some "group" tests that use a different json where additional stubbing was required.
Because the setup is now done in the helper, I was able to remove a lot of feature test steps that were ensuring the document type is set up.
0 commit comments