Skip to content

Commit

Permalink
fix(nimbus): Make name field in new UI required
Browse files Browse the repository at this point in the history
Because

- Submitting a form with an empty name field in the new Nimbus UI causes a 500 error.

This commit

- Adds validation to ensure the name field is required and prevents submission with an empty value

Fixes #12016
  • Loading branch information
RJAK11 committed Jan 10, 2025
1 parent fa6bd45 commit 9f73f5e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions experimenter/experimenter/nimbus_ui_new/tests/test_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ def test_name_field_is_required(self):
documentation_link = NimbusDocumentationLinkFactory.create()

form_data = {
"name": "",
"hypothesis": "new hypothesis",
"risk_brand": True,
"risk_message": True,
Expand All @@ -402,6 +403,7 @@ def test_name_field_is_required(self):
form = OverviewForm(data=form_data)

self.assertFalse(form.is_valid())
self.assertIn("name", form.errors)


class TestDocumentationLinkCreateForm(RequestFormTestCase):
Expand Down

0 comments on commit 9f73f5e

Please sign in to comment.