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

test: added redux, selector and api cases #350

Merged
merged 5 commits into from
Jun 19, 2023
Merged

Conversation

sundasnoreen12
Copy link
Contributor

@sundasnoreen12 sundasnoreen12 commented Jun 15, 2023

INF-878
Description
Add unit tests for notifications redux, selectors and API

  1. Add Factory for
    a. Notifications Count
    b. Notification List

  2. API test cases
    a. successfully get notification counts for different tabs
    b. failed to get notification counts
    c. denied to get notification counts
    d. successfully get notifications
    e. failed to get notifications
    f. denied to get notifications
    g. successfully marked all notifications as seen for selected app
    h. failed to mark all notifications as seen for selected app
    i. denied to mark all notifications as seen for selected app
    j. successfully marked all notifications as read for selected app
    k. failed to mark all notifications as read for selected app
    l. denied to mark all notifications as read for selected app
    m. successfully marked notification as read
    n. failed to mark notification as read
    o. denied to mark notification as read

  3. Add test cases for following selectors:
    a. should return notification status
    b. should return notification tabs count
    c. should return notification tabs
    d. should return selected app notification ids
    e. should return show notification tray status
    f. should return notifications
    g. should return notifications from Ids
    h. should return selected app name
    i. should return pagination data.

  4. Redux test cases
    a. Successfully loaded initial notification states in redux
    b. Successfully loaded notifications list in the redux
    c. Successfully loaded notification counts in the redux
    d. Successfully loaded showNotificationTray status in the redux based on api
    e. Successfully store the count, numPages, currentPage, and nextPage data in redux
    f. Successfully updated the selected app name in redux
    g. Successfully store notification ids in the selected app in apps
    h. successfully marked all notifications as seen for selected app
    i. successfully marked all notifications as read for selected app in the redux.
    j. successfully marked notification as read in the redux.

    Tested
    Npm run test

@sundasnoreen12 sundasnoreen12 changed the title Sundas/inf 878 test: added redux, selector and api cases Jun 15, 2023
@codecov
Copy link

codecov bot commented Jun 15, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +19.05 🎉

Comparison is base (dad01fc) 43.33% compared to head (a52ddfd) 62.39%.

Additional details and impacted files
@@             Coverage Diff             @@
##           master     #350       +/-   ##
===========================================
+ Coverage   43.33%   62.39%   +19.05%     
===========================================
  Files          28       30        +2     
  Lines         570      585       +15     
  Branches      108      108               
===========================================
+ Hits          247      365      +118     
+ Misses        310      212       -98     
+ Partials       13        8        -5     
Impacted Files Coverage Δ
...ations/data/__factories__/notifications.factory.js 100.00% <100.00%> (ø)
src/Notifications/data/api.js 100.00% <100.00%> (+83.33%) ⬆️
src/Notifications/data/thunks.js 93.54% <100.00%> (+66.12%) ⬆️
src/test-utils.js 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

src/Notifications/data/api.js Outdated Show resolved Hide resolved
src/Notifications/data/api.js Outdated Show resolved Hide resolved
src/Notifications/data/thunks.js Outdated Show resolved Hide resolved
src/Notifications/data/api.test.js Outdated Show resolved Hide resolved
src/Notifications/data/api.test.js Outdated Show resolved Hide resolved
src/Notifications/data/redux.test.js Outdated Show resolved Hide resolved
@sundasnoreen12 sundasnoreen12 force-pushed the sundas/INF-878 branch 5 times, most recently from 683a582 to 32f56f2 Compare June 19, 2023 10:06
src/Notifications/data/api.test.js Outdated Show resolved Hide resolved
src/Notifications/data/api.test.js Outdated Show resolved Hide resolved
src/Notifications/data/api.js Outdated Show resolved Hide resolved
src/Notifications/data/api.test.js Show resolved Hide resolved
@sundasnoreen12 sundasnoreen12 merged commit 911cea6 into master Jun 19, 2023
@sundasnoreen12 sundasnoreen12 deleted the sundas/INF-878 branch June 19, 2023 12:10
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