Commit graph

29 commits

Author SHA1 Message Date
Andy Balaam
d3c0435446 Adept KnownMembership imports for new location in types 2024-03-18 14:43:08 +00:00
Andy Balaam
34559d2a89 Adapt Membership usage for the change to an enum KnownMembership 2024-03-18 14:43:08 +00:00
Stanislav Demydiuk
da99bad7b9 Introduce Membership type 2024-03-18 14:43:08 +00:00
Florian Duros
a3a387a1dd
Fix default thread notification of the new RoomHeader (#12194) 2024-01-31 16:24:56 +00:00
David Baker
9254e9562e
Don't reference the notification levels by colour (#12138)
* Don't reference the notification levels by colour

We're about to change what colours they are so either we'd have to rename
a bunch of constants. We may as well make things not reference what colour
anything is in the actual UI. Hopefully these constants are clear enough.

 * Rename NotificationColor -> NotificationLevel
 * Red -> Highlight
 * Grey -> Notification
 * Bold -> Activity
 * Anywhere else that calls it 'color' -> 'level'

Also fixes some weird mixes of US & UK English.

It turns out this is referenced in... quite a lot of places, so this is
quite a large PR. It can't really be much smaller, sorry.

* One test rename & some hiding due to ts-ignore

* More hiding behind ts-ignore

* Damn you, @ts-ignore...

* Fix test CSS values

* Missed some colour -> level

Co-authored-by: Florian Duros <florianduros@element.io>

* Change other instances of variables renamed in suggestion

* Update new test for renames

---------

Co-authored-by: Florian Duros <florianduros@element.io>
2024-01-15 15:25:48 +00:00
David Baker
406ffe1b98
Add test for useRoomThreadNotifications (#12140)
* Add test for useRoomThreadNotifications

* Remove unused code
2024-01-12 15:32:56 +00:00
David Baker
02a8023ba3 Revert accidental commit to develop 2024-01-12 14:50:59 +00:00
David Baker
6247055df6 Add test for useRoomThreadNotifications
Doesn't test the the updating on event emitters but it's a start
2024-01-12 14:46:41 +00:00
Michael Telatynski
e6c127915f
Fix useRoomMembers missing updates causing incorrect membership counts (#11392)
* Fix useRoomMembers missing updates

* Also fix useRoomMemberCount

* Add tests
2023-08-09 12:27:37 +00:00
Michael Telatynski
47877ba2da
Switch to importing matrix-js-sdk from its main export (#11360)
* Switch to importing TypedEventEmitter from main js-sdk export

* Switch to importing js-sdk/matrix in cypress

* Remove duplicated imports

* Fix lint:js-fix to run prettier last otherwise ESLint --fix may cause a mess

* Add lint rule

* Fix cypress-axe import

* Fix cypress-axe import
2023-08-03 12:56:30 +00:00
Janne Mareike Koschinski
97765613bc
Implement new model, hooks and reconcilation code for new GYU notification settings (#11089)
* Define new notification settings model

* Add new hooks

* make ts-strict happy

* add unit tests

* chore: make eslint/prettier happier :)

* make ts-strict happier

* Update src/notifications/NotificationUtils.ts

Co-authored-by: Robin <robin@robin.town>

* Add tests for hooks

* chore: fixed lint issues

* Add comments

---------

Co-authored-by: Robin <robin@robin.town>
2023-06-17 00:17:51 +00:00
Michael Telatynski
6b46d6e4f8
Add MatrixClientPeg::safeGet and use it in tests (#10985) 2023-06-05 18:12:23 +01:00
alunturner
73360026ab
Convert remaining hook tests to RTL (#10166)
* convert useProfileInfo to RTL
* convert useLatestResult to RTL
2023-02-16 14:13:05 +00:00
Michael Telatynski
e8b92b308b
Conform more code to strict null checking (#10169)
* Conform more code to strict null checking

* delint

* Iterate

* delint

* Fix bad test
2023-02-16 09:38:44 +00:00
alunturner
a4ff959aa1
Convert useUserDirectory tests to RTL (#10160) 2023-02-14 16:01:10 +00:00
alunturner
731ef1b1ea
Convert useSlidingSyncRoomSearch tests to RTL (#10161) 2023-02-14 15:04:13 +00:00
alunturner
4012f0c591 Convert usePublicRoomDirectory to RTL (#10162)
* convert enzyme to rtl
* sort out TS issues
2023-02-14 15:02:52 +00:00
Michael Telatynski
61a63e47f4
Comply with noImplicitAny (#9940)
* Stash noImplicitAny work

* Stash

* Fix imports

* Iterate

* Fix tests

* Delint

* Fix tests
2023-02-13 11:39:16 +00:00
Clark Fischer
431afaafc6
Unify unread notification state determination (#9941)
* Add tests for unread notification facilities

Add some tests to guarantee some consistency in `useUnreadNotifications` and
`RoomNotificationState`.

Signed-off-by: Clark Fischer <clark.fischer@gmail.com>

* Add RoomNotifs#determineUnreadState

Intended as a singular replacement for the divergent implementations before.

Signed-off-by: Clark Fischer <clark.fischer@gmail.com>

* Unify room unread state determination

Have both the class-based facility and the hook use the new unified logic in
`RoomNotifs#determineUnreadState`.

Addresses https://github.com/vector-im/element-web/issues/24229

Signed-off-by: Clark Fischer <clark.fischer@gmail.com>

---------

Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2023-01-31 09:58:17 +00:00
Kegan Dougal
7616f71ff2 TS 2023-01-20 17:20:20 +00:00
Kegan Dougal
153a3a7998 Add hook test 2023-01-20 15:58:06 +00:00
Marco Bartelt
1b06b72b67
static-user-onboarding-steps (#9799) 2023-01-02 14:34:34 +00:00
Michael Weimann
526645c791
Apply prettier formatting 2022-12-12 12:24:14 +01:00
Florian Duros
d5e076bc3d
Use react-testing-library instead of enzyme for useDebouncedCallback 2022-11-17 12:01:31 +01:00
Travis Ralston
e0d5b11bab
Add a larger buffer to useLatestResult's test (#9178)
Should fix https://github.com/vector-im/element-web/issues/23014

With only a 5ms buffer previously it was possible for Jest to get overwhelmed with the 1500 tests it needs to run. We raise this to 20ms to give extra time to settle.

Even with the high sleep times this won't be the longest running test, so should be fine.

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2022-08-25 14:49:39 -06:00
Michael Weimann
27ba1e57e6
Update matrix-org/react (enzyme deprecation) (#9116) 2022-08-02 15:10:43 +02:00
Travis Ralston
60d3d41184
Improve timing safety of useLatestResult test (#8915)
and fix contains to be equals instead, as it's *possible* we can accidentally punch in 20 or something and still have the test pass.
2022-06-28 15:29:01 +02:00
Janne Mareike Koschinski
5096e7b992
Integrate searching public rooms and people into the new search experience (#8707)
* Implement searching for public rooms and users in new search experience
* Implement loading indicator for spotlight results
* Moved spotlight dialog into own subfolder
* Extract search result avatar into separate component
* Build generic new dropdown menu component
* Build new network menu based on new network dropdown component
* Switch roomdirectory to use new network dropdown
* Replace old networkdropdown with new networkdropdown
* Added component for public room result details
* Extract hooks and subcomponents from SpotlightDialog
* Create new hook to get profile info based for an mxid
* Add hook to automatically re-request search results
* Add hook to prevent out-of-order search results
* Extract member sort algorithm from InviteDialog
* Keep sorting for non-room results stable
* Sort people suggestions using sort algorithm from InviteDialog
* Add copy/copied tooltip for invite link option in spotlight
* Clamp length of topic for public room results
* Add unit test for useDebouncedSearch
* Add unit test for useProfileInfo
* Create cypress test cases for spotlight dialog
* Add test for useLatestResult to prevent out-of-order results
2022-06-15 16:14:05 +02:00
Germain
408f4dfe09
Add public room directory hook (#8626) 2022-05-19 09:03:29 +01:00