Commit Graph

94 Commits (8958be93211da0b3a48a1bcad2b7d7e3f8efbe62)

Author SHA1 Message Date
turt2live 0363f73e28 Fix the MessagePanel test
Signed-off-by: Travis Ralston <travpc@gmail.com>
2017-09-14 20:57:28 -06:00
David Baker 609d61d53c Revert "Implement sticky date separators" 2017-09-06 17:40:58 +01:00
Luke Barnard 69bce6aee5 Update tests to reflect not supressing first date separator 2017-08-30 17:35:26 +01:00
Luke Barnard c4f049effe Merge pull request #1243 from matrix-org/t3chguy/hide-join-part-2
T3chguy/hide join part (attempt) 2
2017-07-26 17:15:43 +01:00
Luke Barnard f7145941fd Add tests to assert correct MD mention link stripping
Tab-completed @Mentions should only be sent as display names in the `body` of the event. The HTML should be unaffected, and always sent as an anchor tag.
2017-07-24 14:42:20 +01:00
Michael Telatynski 928294eba3
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into t3chguy/hide-join-part-2 2017-07-21 19:23:42 +01:00
Michael Telatynski f036fd1d0f
first attempt at stubbing tests
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-07-21 19:16:30 +01:00
Richard van der Hoff 0d7cc59d99 replace q method calls with bluebird ones
```
find src test -name '*.js' |
    xargs perl -i -pe 's/q\.(all|defer|reject|delay|try|isFulfilled)\(/Promise.$1(/'
```
2017-07-12 18:05:40 +01:00
Richard van der Hoff 0254d2b3a2 q(...) -> Promise.resolve
```
find src test -name '*.js' | xargs perl -i -pe 's/\b[qQ]\(/Promise.resolve(/'
```
2017-07-12 18:05:08 +01:00
Richard van der Hoff a06bd84213 replace imports of `q` with bluebird
update `package.json`

```
find src test -name '*.js' |
   xargs perl -i -pe 'if (/require\(.[qQ].\)/) { $_ = "import Promise from '\''bluebird'\'';\n"; }'

find src test -name '*.js' |
   xargs perl -i -pe 'if (/import [qQ]/) { $_ = "import Promise from '\''bluebird'\'';\n"; }'
```
2017-07-12 18:05:08 +01:00
Richard van der Hoff 7455002b1a InteractiveAuthDialogTest: increase timeout
Blindly increase the number of attempts, because it's failing on travis, but
not on my dev box...
2017-07-12 00:24:00 +01:00
Richard van der Hoff ab61b6b1b6 Use matrix-react-test-utils rather than our own impl
waitForRenderedDOMComponentWithTag is now in matrix-react-test-utils.
2017-07-11 23:14:56 +01:00
Luke Barnard 3bab720a7b Merge pull request #1208 from matrix-org/rav/timelinepanel_test_flakiness
Fix a flaky test in the timelinepanel code
2017-07-11 18:10:55 +01:00
Richard van der Hoff 1139dd2be5 Fix a flaky test in the timelinepanel code
Sometimes it was possible for there to be a scroll event before the initial
pagination completed, which then upset the rest of the test. Just give it a few
ms to sort itself out instead.
2017-07-11 17:34:46 +01:00
Luke Barnard c9df079464 Merge pull request #1176 from matrix-org/luke/feature-enable-RTE
Take RTE out of labs! 🎉
2017-07-10 13:56:00 +01:00
Richard van der Hoff 167ce88a80 Rewrite ScrollPanel test
It turns out that Chrome now implements scroll-anchoring itself (ie, content
stays in the same place when you add more stuff off-screen), which means we
cannot rely on back-pagination to make ScrollPanel do a scroll.

Instead, just do a scrollToToken. Which turns out to be considerably simpler
anyway.
2017-07-05 14:34:25 +01:00
Luke Barnard e3f2eb5232 Take RTE out of labs! 🎉
This stops react-sdk from tracking any state previously stored for the purposes of enabling or disabling the lab feature that enabled the new MessageComposer. It is now enabled permanently.

This is being done with the hope that we can get more feedback for it so that when we release we can be confident that people will be OK with the changes it brings.
2017-07-04 14:44:55 +01:00
Luke Barnard 030358e764 Clarify test names 2017-06-30 12:56:19 +01:00
Luke Barnard 80a73a50f5 Update tests
When sending the letter "a" we expect it to be sent as a text message when RTE is enabled because we now detect that there is no formatting or styled blocks in the composer. We also expect emoji to be sent as plaintext if there is no formatting
2017-06-30 12:39:08 +01:00
Luke Barnard 004d4828f8 Make the tests pass
sendTextMessage is not called when RTE Markdown is enabled, but rather sendHtmlMessage
2017-06-23 17:08:37 +01:00
Matthew Hodgson 5c885922d9 Merge branch 'develop' into new-guest-access 2017-05-28 22:58:18 +01:00
David Baker 0de0b8954d Trailing whitespace 2017-05-26 12:03:36 +01:00
David Baker e44f3cc709 Fix tests
* Serve translation files from the karma server
 * Port UserSettingsStore to ES6 exports because the test runner
   gets confused by ES6 importing a commonjs module
 * Remove extra spaces in translations strings for MELS
 * Fix 'his/her' back to be 'their'
 * Change test to expect singular 'invitation' for a single person
   (there may be multiple invitations, but IMO this should be
   'rejected n invitations' and we can play with the wording later,
   I don't think the singular is any worse than the plural).
 * set language in the MELS tests (and wait for it to complete)
 * Don't bother setting lang in other tests for now
2017-05-26 11:58:45 +01:00
David Baker ba8e37a84e Don't include src in the test resolve root
Don't include src in resolve root for the karma test, as otherwise
modules from react sdk get pulled in instead of npm libraries like
'extend' which breaks everything in really subtle ways.
2017-05-25 23:13:49 +01:00
Luke Barnard 298c5e4df3 Implement a store for RoomView
This allows for a truely flux-y way of storing the currently viewed room, making some callbacks (like onRoomIdResolved) redundant and making sure that the currently viewed room (ID) is only stored in one place as opposed to the previous many places.

This was required for the `join_room` action which can be dispatched to join the currently viewed room.

Another change was to introduce `LifeCycleStore` which is a start at encorporating state related to the lifecycle of the app into a flux store. Currently it only contains an action which will be dispatched when the sync state has become PREPARED. This was necessary to do a deferred dispatch of `join_room` following the registration of a PWLU (PassWord-Less User).

The following actions are introduced:
 - RoomViewStore:
    - `view_room`: dispatch to change the currently viewed room ID
    - `join_room`: dispatch to join the currently viewed room
 - LifecycleStore:
    - `do_after_sync_prepared`: dispatch to store an action which will be dispatched when `sync_state` is dispatched with `state = 'PREPARED'`
 - MatrixChat:
    - `sync_state`: dispatched when the sync state changes. Ideally there'd be a SyncStateStore that emitted an `update` upon receiving this, but for now the `LifecycleStore` will listen for `sync_state` directly.
2017-05-24 16:56:13 +01:00
Luke Barnard e1089574ae Write some tests for the RTS UI
Add tests that make assertions about the UI during registration when registration is done with a user recognised as a team member (by the mock rtsClient).
2017-05-17 09:46:17 +01:00
Luke Barnard bfa3123f9b Combine data-scroll-token and -contained-scroll-tokens
- Instead of using one attribute, use one that might just contain one token
 - Use the first token when tracking a child
 - Mandate that no commas can be in individual tokens
2017-05-04 10:00:13 +01:00
David Baker 23c38bd8a3 Put back both done's
mocha takes the exception arg and does the right thing
2017-03-16 17:47:15 +00:00
David Baker 375ae8fb04 Fix password UI auth test
By adding a way to wait a short time for a component to appear in
the DOM, so we don't get flakey failures like this when we change
something to returning a promise that needs to resolve before the
component actually appears.
2017-03-16 17:26:42 +00:00
David Baker 51467506f8 Port registration over to use InteractiveAuth
These changes are moved over from the dbkr/msisdn_signin branch
2017-02-24 11:41:23 +00:00
David Baker 8fc3104507 Replace submit button with a spinner when busy
and update test accordingly
2017-02-13 18:52:33 +00:00
Richard van der Hoff cd1cf09dc9 Make tests pass on Chrome again
It seems that a number of the tests had started failing when run in
Chrome. They were fine under PhantomJS, but the MegolmExport tests only work
under Chrome, and I need them to work...

Mostly the problems were timing-related, where assumptions made about how
quickly the `then` handler on a promise would be called were no longer
valid. Possibly Chrome 55 has made some changes to the relative priorities of
setTimeout and sendMessage calls.

One of the TimelinePanel tests was failing because it was expecting the contents
of a div to take up more room than they actually were. It's possible this is
something very environment-specific; hopefully the new value will work on a
wider range of machines.

Also some logging tweaks.
2017-01-31 22:40:53 +00:00
Luke Barnard 24e94787dd A lot of linting 2017-01-25 10:52:55 +00:00
Luke Barnard d5edf26371 Improve comment 2017-01-25 10:39:39 +00:00
Luke Barnard e9719b1766 Get rid of .only 2017-01-25 09:12:29 +00:00
Luke Barnard bd106968ce Merge branch 'develop' into luke/fix-join-part-collapsing-causality
Conflicts:
	src/components/structures/MessagePanel.js
2017-01-24 14:22:18 +00:00
Johannes Löthberg 14ead373e2 Add markdown test-cases
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
2017-01-18 20:54:34 +01:00
lukebarnard 41d2697e28 Remove `done`, const instead of var for `requier`s 2017-01-18 12:03:38 +01:00
lukebarnard 867a532e5e Remove parentDiv from tests 2017-01-18 11:58:54 +01:00
lukebarnard 78e2c787e0 Refactor and document test helpers. 2017-01-18 11:53:17 +01:00
lukebarnard 5dd1512ff2 Move aggregation code to dedicated function 2017-01-18 10:59:19 +01:00
lukebarnard 3ba9f50873 Move functions around, remove redundancies, add docs 2017-01-17 19:07:45 +01:00
lukebarnard 49f2b9df88 Remove duplicate test 2017-01-17 18:53:38 +01:00
lukebarnard ade7c65617 Add test for MemberEventListSummary 2017-01-17 12:01:54 +01:00
David Baker e52907a462 Missed semicolon 2016-12-09 10:59:05 +00:00
David Baker 289f8ab439 Fix failing test
For some reason, update webpack causes the promise to no longer
complete by the next tick. Change the test to not depend on how
fast the promise goes through.
2016-12-08 18:44:38 +00:00
Luke Barnard 8a6ed1d7e9 Do not assume unpagination will occur during scroll test 2016-11-22 17:43:45 +00:00
Luke Barnard cf41155610 Test TimelinePanel canForwardPaginate (#561)
Fix scroll up, down pagination test

NB: this test may not fail on Travis, although it did fail locally without a fix: #563.

Once the test has scrolled the panel to the top, to the earliest events, it should be able to forward paginate, because some degree of unpagination occurs. This does assume that unpagination will occur when scrolling to the beginning of the events and that unpagination should allow pagination again in the same direction.

Instead of checking that the first event is no longer the first event (varies due to unpagination), check instead that the most recent event can be seen when scrolling all the way down to the bottom of the TimelinePanel.

Scrolling past the bottom of content seems to have strange behaviour, which isn't a useful part of the test. So now the test will scroll down until the last event instead.
2016-11-18 11:44:45 +00:00
Luke Barnard b718f1542c Fix infinite loop when there are a lot of invisible events (#554)
Instead of using a window of a fixed number of events, unpaginate based on the distance of the viewport from the end of the scroll range.

The ScrollPanel uses the scrollTokens to convey to its parent (the TimelinePanel, in this case) the point to unpaginate up to. The TimelinePanel then takes a chunk of events off the front or back of `this.state.events` using `timelineWindow.unpaginate`.

Fixes https://github.com/vector-im/vector-web/issues/2020
2016-11-16 14:25:52 +00:00
Richard van der Hoff 22757cfcd3 Inject MatrixClient into React context in tests
Now that EventTile expects MatrixClient in the context, we had better provide
it.
2016-11-14 18:22:56 +00:00