Skip to content

Latest commit

 

History

History
62 lines (49 loc) · 3.44 KB

File metadata and controls

62 lines (49 loc) · 3.44 KB

The website must contain a drop-down which lists exactly 5 users Manually tested by loading the page and counting the options in the dropdown. getUserIds() in common.mjs returns exactly 5 IDs (["1","2","3","4","5"]), which are rendered as <option> elements by populateUserDropdown() in script.js.

No user is selected on page load Manually tested by loading the page and confirming the dropdown shows "choose a user" and no agenda is displayed.

All of the users must have no agenda when first loading (i.e. with clear localStorage). Data should be persisted across page loads (which is handled by the code in storage.mjs). Manually tested by clearing localStorage in DevTools (Application tab → Local Storage → Clear All), reloading the page, selecting each user, and confirming the empty state message appears for all 5 users.

Selecting a user must load the relevant user's agenda from storage Manually tested by adding topics for different users, refreshing the page, and selecting each user to confirm their data persisted and loaded correctly.

Selecting a user must display the agenda for the relevant user (see manual testing below) Manually tested using the rubric's manual testing steps for User 1, User 2, and User 3. All revision dates matched the expected output exactly.

If there is no agenda for the selected user, a message is displayed to explain this Manually tested by selecting a user with no stored topics and confirming the message "No agenda found for the current user" is displayed.

The website must contain a form with inputs for a topic name and a date picker. The form should also have a submit button. Manually tested by inspecting the page. All three elements are present and correctly labelled.

The date picker must default to today’s date on first page load Manually tested by loading the page and confirming the date input shows today's date. This is set in window.onload using stringifiedTodayDate() from dates.js.

The form has validation to ensure that both the topic name and and selected date have been set by the user Manually tested by:

  • Submitting with an empty topic name — blocked with status message
  • Submitting with only whitespace in topic name — blocked with status message
  • Submitting a duplicate topic name — blocked with status message
  • Both inputs have required attributes for browser-level validation

Submitting the form adds a new topic to revise for the relevant user only. The topic’s dates to revise are calculated as one week, one month, three months, six months and one year from the selected date (see manual testing below) Unit tests in dates.test.mjs. The calculateRevisionDates function is tested for all 5 intervals (+1 week, +1 month, +3 months, +6 months, +1 year), including across daylight saving time boundaries.

After creating a new topic to revise, the agenda for the current user is shown, including the new topic Manually tested by adding a topic and confirming the agenda updates immediately without needing to refresh or reselect the user.

The website must score 100 for accessibility in Lighthouse Tested using Lighthouse in Chrome DevTools on all three views:

  • Page load with no user selected
  • User selected with no agenda
  • User selected with agenda items All three views scored 100.

Unit tests must be written for at least one non-trivial function Unit tests in dates.test.mjs. Tests cover calculateRevisionDates with 4 test cases including DST boundary checks. Run with npm test.