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

Fix new notifications count #4360

Merged
merged 6 commits into from
Feb 18, 2021
Merged

Fix new notifications count #4360

merged 6 commits into from
Feb 18, 2021

Conversation

javierm
Copy link
Member

@javierm javierm commented Feb 16, 2021

Objectives

  • Fix a bug which displayed the total number of notifications instead of the new ones
  • Simplify code displaying the number of new notifications
  • Write test form the user's point of view, making them more robust

Notes

One test in "Debate behaves like notifiable in-app" failed in the admin_budgets branch when rezising the tests browser window size to 1200x750 due to a <span> being clicked right on the edge of the window. Clicking the link instead seems to solve the problem.

@javierm javierm added the Bug label Feb 16, 2021
@javierm javierm self-assigned this Feb 16, 2021
@javierm javierm added this to Reviewing in Consul Democracy via automation Feb 16, 2021
Other than simplifying the view, we can write tests using `click_link`,
which makes the tests more robust. Clicking the `.icon-notification`
element was causing some tests to fail when defining a window height of
750 pixels in the `admin_budgets` branch.
It was hard to know where the numbers were coming from; they depended on
the padding of the link and the size of the notification icon size. So
we're using variables to make it more explicit.

However, the code is now too complex, so we'll probably have to simplify
it in the future.
We were displaying the total number of notifications with a message "You
have N unread notifications", but were using the total number of
notifications instead of the unread ones.
We couldn't do this refactoring earlier because we weren't using the
unread notifications count. This was fixed in the previous commit.
Consul Democracy automation moved this from Reviewing to Testing Feb 18, 2021
@javierm javierm merged commit d1cbc1e into master Feb 18, 2021
@javierm javierm deleted the notifications_link branch February 18, 2021 15:53
Consul Democracy automation moved this from Testing to Release 1.3.0 Feb 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants