Fix soft crash around unknown room pills (#9301)
* Fix soft crash around unknown room pills * Add tests * Fix types
This commit is contained in:
parent
7e435eef13
commit
fa2ec7f6c9
2 changed files with 12 additions and 5 deletions
|
@ -15,6 +15,7 @@ limitations under the License.
|
|||
*/
|
||||
|
||||
import { EmojiPart, PlainPart } from "../../src/editor/parts";
|
||||
import { createPartCreator } from "./mock";
|
||||
|
||||
describe("editor/parts", () => {
|
||||
describe("appendUntilRejected", () => {
|
||||
|
@ -32,4 +33,10 @@ describe("editor/parts", () => {
|
|||
expect(part.text).toEqual(femaleFacepalmEmoji);
|
||||
});
|
||||
});
|
||||
|
||||
it("should not explode on room pills for unknown rooms", () => {
|
||||
const pc = createPartCreator();
|
||||
const part = pc.roomPill("#room:server");
|
||||
expect(() => part.toDOMNode()).not.toThrow();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue