Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-factor assessment store to inject the initialAssessmentStoreDataGenerator dependency #463

Merged

Conversation

haonliu
Copy link
Contributor

@haonliu haonliu commented Mar 27, 2019

Pull request checklist

  • Addresses an existing issue: Fixes #0000
  • Added relevant unit test for your changes. (npm run test)
  • Verified code coverage for the changes made. Check coverage report at: <rootDir>/test-results/unit/coverage
  • Ran precheckin (npm run precheckin)
  • Added screenshots/GIFs for UI changes.

Description of changes

Since a lot of tests are dependent on assessment store data builder, we have to make changes to many tests to ensure that they don't break. A lot of them are dependent on some state being given by the store data builder so we've gone with an internal mock approach, although not fully ideal, to return the state as expected.

@haonliu haonliu requested a review from a team March 27, 2019 23:15
src/tests/unit/common/assessment-store-data-builder.ts Outdated Show resolved Hide resolved
@waabid waabid requested a review from markreay March 29, 2019 01:12
const assessmentData = config.getAssessmentData(this.state);
if (assessmentData.generatedAssessmentInstancesMap == null) {
return;
}
Copy link
Member

Choose a reason for hiding this comment

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

This change is not absolutely necessary in this PR but I figured to make it since I was working within the test for this and found it odd that it was not behaving per whatever was sent in the payload. Since this is hidden behind a non-public feature flag, I would feel comfortable moving forward with this.

@waabid waabid changed the title assessment store refactor Re-factor assessment store to inject the initialAssessmentStoreDataGenerator dependency Mar 29, 2019
@@ -27,6 +28,9 @@ const assessmentWithColumns: Assessment = {
title: 'assessment 1',
gettingStarted: null,
guidance: content.assessment1.guidance,
initialDataCreator: () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

does it make sense to extract this function?

smoralesd
smoralesd previously approved these changes Mar 29, 2019
Shobhit1
Shobhit1 previously approved these changes Mar 29, 2019
@waabid waabid dismissed stale reviews from Shobhit1 and smoralesd via 6dc6180 March 29, 2019 19:03
@smoralesd smoralesd closed this Mar 29, 2019
@smoralesd smoralesd reopened this Mar 29, 2019
@smoralesd smoralesd merged commit a6d7cfa into microsoft:master Mar 29, 2019
@waabid waabid added the pr: auto-merge Automatically squash merge all checks have passed and approvals granted. There is a 15 minute delay. label Mar 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: auto-merge Automatically squash merge all checks have passed and approvals granted. There is a 15 minute delay.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants