Replace factory with createComponent in FE specs
Problem
I noticed that we have a fair mix of const factory
and const createComponent
across all the frontend specs. Couple of the frontend testing GitLab docs mention (one of them is frontend_testing) createComponent
and I personally like it as well.
While the customers source code is small, I recommend we stick to one and make it consistent across all files.
Files | |
---|---|
factory | 30 |
createComponent | 12 |
Used this search to find the counts.
> grep --include=\*spec.js -rnw spec -e 'const factory' | wc -l
30
> grep --include=\*spec.js -rnw spec -e 'const createComponent' | wc -l
12
Proposal
This issue is to gather feedback on which one we should go forward with (hint: createComponent ;))
Result
- Consistency in the code base.
- Sticking to GitLab's best practices.
- Makes it easier to move our FE pieces of GitLab (if and when necessary)
Next steps (if any)
- Gather team feedback
- Decide on one of
factory
orcreateComponent
- Create issues to migrate the pages over time.
- Tada
🎉
How will we measure success?
Edited by Angelo Gulina