Fix undefined error in project_templates_spec.rb
Background
- We converted the New Project page dropdown from Haml to Vue in !68778 (merged) behind the feature flag
paginatable_namespace_drop_down_for_project_creation
- We updated the QA tests to pass with this feature flag on in !71085 (merged)
- We turned on the feature flag on staging, but one QA test failed due to an
undefined
error
What does this MR do and why?
This MR fixes the QA failure identified in #342689 (closed). It adds a null check to fix an error when a variable is undefined, which happens when creating a new project using a template from a group (see screencast below).
Screenshots or screen recordings
Screen_Recording_2021-10-11_at_1.20.49_pm
How to set up and validate locally
- In rails console enable the feature flag
Feature.enable(:paginatable_namespace_drop_down_for_project_creation)
- Go to a group that contains subgroups then create New Project from there
- Click
Create from template
- Click the
Group
tab - Click
Use template
for any group and see that the form is shown with no console errors
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #342689 (closed)
Edited by Coung Ngo