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

Mock Assessment API calls #113

Merged
merged 30 commits into from
Jun 20, 2018
Merged

Mock Assessment API calls #113

merged 30 commits into from
Jun 20, 2018

Conversation

remo5000
Copy link
Contributor

@remo5000 remo5000 commented Jun 18, 2018

Features

  • Assessment-related information is properly typed (with respect to the backend)
  • Sagas added to "mock" fetching from the API, but in reality fetches data from a file

Issues fixed

TODO

  • Add data types
  • Type the displayed data properly
    • Assessment/index
    • Academy/Missions (generalise dispatch)
  • Remove default mock data
  • Add sagas for fetching "data"

What's next

  • Generalise Missions to use for all 4 Assessment categories (using higher order or generics)
  • Generalise the button link and location parameter for Mission for all assessments

@remo5000 remo5000 changed the title [WIP] Mock Assessment API calls Mock Assessment API calls Jun 19, 2018
@remo5000 remo5000 requested a review from ning-y June 19, 2018 15:42
Also added a counter for all the ids
- Only closed assessment previews available (2 of them)
- 3 open assessment previews
- Changed dates to string
The union of interfaces seems to work.
Also:
- Used `Array<T>` for definition in mock api
- Formatted AssessmentContainer
Also removed category-specific assessments
Also added an enum for AssessmentCategory
The problem was with a faulty dataset.Also added
- Fix for not showing "loading" page (which was a mistake I made a few
commits ago)
- Spacing out for contentdisplay cards
This is because the API fetch is to fetch all the previews. Having the
parameter for category there, but not using it (or using it, resulting
in multiple calls for multiple categories) is not preferred.
Note that the initial data is still not removed.
The default value for the overviews is now undefined so as to
simulate the fetching.
Moved the fetch dispact in the academy/mission component from the render
function to the componentWillMount function, as we should not render
(due to content updates) while the render function is running.
@coveralls
Copy link

coveralls commented Jun 20, 2018

Pull Request Test Coverage Report for Build 25

  • 35 of 52 (67.31%) changed or added relevant lines in 10 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.3%) to 30.409%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/components/assessment/index.tsx 1 5 20.0%
src/reducers/session.ts 1 5 20.0%
src/sagas/index.ts 4 13 30.77%
Totals Coverage Status
Change from base Build 16: 0.3%
Covered Lines: 1091
Relevant Lines: 3141

💛 - Coveralls

@ning-y ning-y merged commit b388c03 into master Jun 20, 2018
@ning-y ning-y deleted the mock-api-calls branch June 20, 2018 04:53
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.

None yet

3 participants