Skip to content

North West | 26-ITP-Sep | Brian Yorachi | Sprint 3 | Feature/sprint 3 quote generator - #1532

Open
BrianY315 wants to merge 7 commits into
CodeYourFuture:mainfrom
BrianY315:feature/sprint-3-quote-generator
Open

BrianY315 wants to merge 7 commits into
CodeYourFuture:mainfrom
BrianY315:feature/sprint-3-quote-generator

Conversation

@BrianY315

Copy link
Copy Markdown

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Task code

CYF-1096

Changelist

This PR completes the quote generator: it displays a random quote and author on page load, and the New Quote button shows another without repeating the current quote. It also updates the page title and adds a regression test for repeated random selections.

@BrianY315 BrianY315 changed the title North West | 26-ITP-Sep | Brian Yorachi | Sprint 2 | Feature/sprint 3 quote generator North West | 26-ITP-Sep | Brian Yorachi | Sprint 3 | Feature/sprint 3 quote generator Nov 16, 2026
@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

@BrianY315
BrianY315 force-pushed the feature/sprint-3-quote-generator branch from bfdfbd8 to bde613f Compare November 16, 2026 15:02
@BrianY315 BrianY315 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Nov 16, 2026
Comment on lines +23 to +25
await new Promise((resolve) => {
page.window.document.addEventListener("load", resolve);
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What has already happened by the time JSDOM.fromFile resolves, and will this listener still see that load event?

To "like" or "dislike" this comment, please follow this link

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JSDOM.fromFile() resolves after reading the HTML and creating the DOM, not after the page’s load event. Here, readyState was still loading, so the listener caught it. I’ve made the wait robust by checking readyState first and otherwise listening once for load on window; the tests pass.

@cyf-ai-code-reviewer cyf-ai-code-reviewer Bot added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Nov 16, 2026
@cyf-ai-code-reviewer

Copy link
Copy Markdown

The CYF AI review has left comments. It will only review a PR one time. When you have addressed these comments, please request review again and a volunteer will take a look.

@BrianY315 BrianY315 added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant