-
Notifications
You must be signed in to change notification settings - Fork 10
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
Enabling default app/page templates for user workspace #52
Conversation
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.
Hmm, not fond about the introduction of testUserWorkspace
.
In general, I favor tests that are very procedural and decoupled and don't share very much logic (business, convenience, or otherwise). Tests aren't necessarily the best case to go too DRY in my experience. I know there was a whenSerialized
before and I had removed that intentionally in #51 for the same reason.
Maybe the real goal here should be to create a directory of specs for the CLI (tests/cli/) and take a queue from webpack and organize our specs according to cases? So it looks like we might have three here?
Either way, I would prefer to walk back the testUserWorkspace
function at minimum and try and keep each describe
as encapsulated as possible with the code it needs. I think TestSetup
is still useful though, and can still be used across all cases since it's pretty simple and narrow in scope.
There is a solid reason for it. We're writing duplicate tests for different cases. We need to test nested, hello, public directory, and js bundles in all scenarios. So I have to disagree with you on that. |
Most of #30 is resolved already in nested directory PR. I simply set it so the default 'page' template would be set to the templates/page-template.js that we include. The label var of #30 is not approachable from this project. We'd have to rewrite the wc-md-loader and somehow incorporate it into this project. We need the name of the label both in the loader and in the scaffold.js. The only way to do that properly would be to have the webpack plugin handle the adding the new wc-md-element to the page-template. This would require some further research. |
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.
So, I think we can both agree the tests could probably be better organized and opportunities to improve here, so let's start from there and continue the discussion in this issue.
However, in a PR already combining two features, I'm not keen on this refactoring on top of it all unfortunately and I don't necessarily concur that making our tests more DRY or convenient for us is should necessarily be the prioritizing factor in terms of how we approach our tests, is all.
Then let's do a separate RFC PR for the tests then considering we have to merge tests from all these PRs first. 3/4 outstanding PRs contain additional tests. If you plan on moving them or reorganizing them, that's a big change and should be dealt with in a different PR. The issues this PR solves are what's important. It has tests for those changes. Changes to these tests(and all the other tests combined) need to be done separately as that has nothing to do with this PR. |
That's not really playing fair, tbh. 😢 The issues this PR solves are important of course, and for that reason should be the only thing being talked about in this PR, but, it isn't, and that's because refactoring unit tests is not the right place / time for something like that. I hope you know you can always ask first, as I think by now the project has well established a consistent 1 issue : 1 PR workflow, so if having done #11 the way we did didn't solidify that further, then aside from putting language like that in CONTRIBUTING.md, not sure what else I should do to help us avoid these scenarios? 😕 |
So you want me to put it back then and then add the duplicate tests? because that's the only way to do it. |
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.
Oh, with this PR we should be able to remove this TODO
line in the README, right?
https://github.com/ProjectEvergreen/greenwood#project-structure
…ask/fix-issue-32-page-app-templates
5b0a550
to
2d9279b
Compare
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.
😎
Related Issue
Resolves #30 #32
Summary of Changes
appTemplatePath
andpageTemplatePath
varpageTemplate
andappTemplate