Skip to content

Make maker homepage a unit test instead of storybook - #49418

Merged
bencodeorg merged 2 commits into
stagingfrom
ben/remove-maker-landing-story
Mar 8, 2023
Merged

Make maker homepage a unit test instead of storybook#49418
bencodeorg merged 2 commits into
stagingfrom
ben/remove-maker-landing-story

Conversation

@bencodeorg

@bencodeorg bencodeorg commented Dec 9, 2022

Copy link
Copy Markdown
Contributor

Working on this PR, I saw this component did not have unit tests, but had a Storybook component. I didn't realize that we had migrated this story already to the new Storybook API.

It looks like it was sort of a 50/50 decision to keep this entry, but I think it's more extensible to have a unit test here than a Storybook entry (eg, can now add a unit test confirming the presence of a notification).

@bencodeorg
bencodeorg requested a review from a team December 9, 2022 19:55
@bencodeorg
bencodeorg changed the base branch from staging-next to staging December 13, 2022 17:58

@fisher-alice fisher-alice left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Makes sense to use a unit test here - I was not sure about this one when I migrated the storybook. Thanks for doing this!

};

shallow(<MakerLanding topCourse={fakeTopCourse} />);
});

@fisher-alice fisher-alice Dec 14, 2022

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is an assertion not wanted here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Correct, the "test" in these "it renders" tests is just that it's able to render (ie, shallow doesn't error).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cool! Would it make sense to add another unit test to check the presence of a notification if included?

@bencodeorg
bencodeorg merged commit f119980 into staging Mar 8, 2023
@bencodeorg
bencodeorg deleted the ben/remove-maker-landing-story branch March 8, 2023 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants