1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-08-09 10:22:46 +03:00

Improve test coverage and modernize style for interactive-auth (#2574)

* style: address no-mixed-operators errors,minor style improvements

* test: Fix async interactive-auth tests, add test case

* tests: Fix incorrectly stringified mock response

* pushprocessor: style update

* use async primitives in interactive-auth-spec

* lint

* fixup: remove duplicate test

* add test case for no-flow-with-session for interactive-auth

* interactive-auth: handle non-existing error.data

* async test fix

* test: add dummyauth test

* add testing for errcode

* Revert "pushprocessor: style update"

This reverts commit 3ed0fdfb73.

* add testcase for missing error data

* test: move sessionId assignment

* Add tests to improve coverage for interactive-auth

* pushprocessor: style update
This commit is contained in:
3nprob
2022-08-11 14:29:53 +00:00
committed by GitHub
parent 478270b225
commit 3f6f5b69c7
7 changed files with 374 additions and 103 deletions

View File

@@ -362,13 +362,9 @@ export class PushProcessor {
return false;
}
let regex;
if (cond.key == 'content.body') {
regex = this.createCachedRegex('(^|\\W)', cond.pattern, '(\\W|$)');
} else {
regex = this.createCachedRegex('^', cond.pattern, '$');
}
const regex = cond.key === 'content.body'
? this.createCachedRegex('(^|\\W)', cond.pattern, '(\\W|$)')
: this.createCachedRegex('^', cond.pattern, '$');
return !!val.match(regex);
}