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 test cases for UI components #360

Merged
merged 3 commits into from
Jul 4, 2023
Merged

Conversation

sundasnoreen12
Copy link
Contributor

Description
INF-917

Added unit tests for following notifications tray components.

  1. Index.jsx
    a. Successfully showed bell icon and unseen count on it if unseen count is greater then 0
    b. Successfully showed notification tray by clicking on the bell icon
    c. Successfully hide notification tray by clicking on the bell icon
    d. Successfully showed setting icon in the notification tray

  2. NotificationTabs.jsx

    1. Successfully showed list of notification tabs
    2. Successfully showed discussion tab selected by default
    3. Selected Tab has no unseen counts
    4. Successfully showed unseen counts for unselected tabs
    5. Successfully selected reminder tab
  3. NotificationSection.jsx

    1. Successfully viewed two sections last 24 hours and earlier
    2. Successfully viewed mark all as read label on the UI
    3. Successfully viewed unread status across unread notification
    4. When the user clicks on the mark all as read, the unread status disappeared across all the notifications
    5. Successfully load more notifications by clicking on load more notification button
  4. NotificationRowItem.jsx

    1. Successfully viewed notification icon, notification context, unread notification icon, course name and notification
      created time for each of the notification in both last 24 hours and earlier section
    2. Successfully marked notification as read

Tested
npm run test

@codecov
Copy link

codecov bot commented Jun 26, 2023

Codecov Report

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

Comparison is base (45a1da9) 62.39% compared to head (7229bff) 79.15%.

Additional details and impacted files
@@             Coverage Diff             @@
##           master     #360       +/-   ##
===========================================
+ Coverage   62.39%   79.15%   +16.76%     
===========================================
  Files          30       31        +1     
  Lines         585      595       +10     
  Branches      108      108               
===========================================
+ Hits          365      471      +106     
+ Misses        212      121       -91     
+ Partials        8        3        -5     
Impacted Files Coverage Δ
src/Notifications/NotificationRowItem.jsx 100.00% <ø> (+83.33%) ⬆️
src/Notifications/NotificationTabs.jsx 100.00% <ø> (+93.33%) ⬆️
src/Notifications/index.jsx 91.30% <ø> (+86.95%) ⬆️
src/Notifications/NotificationSections.jsx 100.00% <100.00%> (+95.65%) ⬆️
src/Notifications/test-utils.js 100.00% <100.00%> (ø)

... and 4 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.

@sundasnoreen12 sundasnoreen12 force-pushed the sundas/INF-917 branch 2 times, most recently from 32406b9 to 31530d6 Compare June 26, 2023 08:35
@sundasnoreen12 sundasnoreen12 requested review from awais-ansari, ayesha-waris and asadazam93 and removed request for awais-ansari June 26, 2023 08:37
src/Notifications/index.test.jsx Outdated Show resolved Hide resolved
src/Notifications/index.test.jsx Outdated Show resolved Hide resolved
src/Notifications/notificationTabs.test.jsx Outdated Show resolved Hide resolved
src/Notifications/notificationTabs.test.jsx Outdated Show resolved Hide resolved
src/Notifications/test-utils.js Outdated Show resolved Hide resolved
src/Notifications/notificationTabs.test.jsx Outdated Show resolved Hide resolved
src/Notifications/NotificationRowItem.jsx Outdated Show resolved Hide resolved
src/Notifications/NotificationSections.jsx Outdated Show resolved Hide resolved
src/Notifications/notificationSections.test.jsx Outdated Show resolved Hide resolved
src/Notifications/notificationSections.test.jsx Outdated Show resolved Hide resolved
src/Notifications/notificationTabs.test.jsx Outdated Show resolved Hide resolved
src/Notifications/index.test.jsx Outdated Show resolved Hide resolved
@sundasnoreen12 sundasnoreen12 merged commit ceb9c13 into master Jul 4, 2023
@sundasnoreen12 sundasnoreen12 deleted the sundas/INF-917 branch July 4, 2023 06:20
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