Closed Bug 1081413 Opened 8 years ago Closed 8 years ago

move url validation code into fjord_utils.js

Categories

(Input Graveyard :: Code Quality, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: willkg, Assigned: aokoye, Mentored)

References

Details

(Whiteboard: u=dev c=codequality p= s=input.2014q4)

We have url validation code that should get moved to fjord_utils.js and then we can add tests for it.

The url validation code is one big regexp here:

https://github.com/mozilla/fjord/blob/master/fjord/feedback/static/js/generic_feedback.js#L114

After it's rewritten, it'll probably look a bit like the validateEmail function:

https://github.com/mozilla/fjord/blob/master/fjord/base/static/js/fjord_utils.js#L9

which has a test here:

https://github.com/mozilla/fjord/blob/master/fjord/base/static/tests/test_fjord_utils.js#L1

See bug #1081412 for more details on writing a unit test.
We can re-use these urls to test this url validation code:

https://github.com/mozilla/fjord/blob/master/smoketests/tests/generic/test_generic_feedback.py#L215

Any other shapes of urls you want to test would be great, too.
Assigning this to Adam.
Assignee: nobody → aokoye
Made a pull request https://github.com/mozilla/fjord/pull/367/commits
Pushed this to prod just now.

Thank you!
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Retro-actively marking myself as a mentor.
Mentor: willkg
Product: Input → Input Graveyard
You need to log in before you can comment on or make changes to this bug.