apple / apple/password-manager-resources

PasswordRulesParser.js should have unit tests

Open
#98 11 comments 0 reactions 0 assignees View on GitHub
testing
Dominant language
JavaScript
Stars
4.8k
Forks
649
Avg merge
9h 50m
Merged PRs (30d)
15

Description

This is a good initiative. But there are:

- no unit tests
- no comments so not able to follow several flows. For eg: what is the method `_parsePasswordRequiredOrAllowedPropertyValue` doing?
- Single line if conditions are lacking braces. Did we forget [goto fail?](https://nakedsecurity.sophos.com/2014/02/24/anatomy-of-a-goto-fail-apples-ssl-bug-explained-plus-an-unofficial-patch/)

Hopefully the code will get improved over time.

Contributor guide

Open the contributing guide

Research direction

Locate PasswordRulesParser.js and read its parsing flows, including _parsePasswordRequiredOrAllowedPropertyValue. Check the repository for the existing unit-test setup before adding coverage for the parser. Done means the parser has unit tests and the reported readability concerns—missing comments and brace-less single-line if statements—are addressed.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
testing
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.