Fix MessageCompoer-test

This commit is contained in:
Florian Duros 2022-10-24 14:41:11 +02:00
parent 50c29502e4
commit edecc451dd
No known key found for this signature in database
GPG key ID: 9700AA5870258A0B

View file

@ -39,7 +39,7 @@ import { SendMessageComposer } from "../../../../src/components/views/rooms/Send
import { E2EStatus } from "../../../../src/utils/ShieldUtils"; import { E2EStatus } from "../../../../src/utils/ShieldUtils";
import { addTextToComposer } from "../../../test-utils/composer"; import { addTextToComposer } from "../../../test-utils/composer";
import UIStore, { UI_EVENTS } from "../../../../src/stores/UIStore"; import UIStore, { UI_EVENTS } from "../../../../src/stores/UIStore";
import { WysiwygComposer } from "../../../../src/components/views/rooms/wysiwyg_composer/components/WysiwygComposer"; import { SendWysiwygComposer } from "../../../../src/components/views/rooms/wysiwyg_composer";
// The wysiwyg fetch wasm bytes and a specific workaround is needed to make it works in a node (jest) environnement // The wysiwyg fetch wasm bytes and a specific workaround is needed to make it works in a node (jest) environnement
// See https://github.com/matrix-org/matrix-wysiwyg/blob/main/platforms/web/test.setup.ts // See https://github.com/matrix-org/matrix-wysiwyg/blob/main/platforms/web/test.setup.ts
@ -346,14 +346,14 @@ describe("MessageComposer", () => {
}); });
}); });
it('should render WysiwygComposer', () => { it('should render SendWysiwygComposer', () => {
const room = mkStubRoom("!roomId:server", "Room 1", cli); const room = mkStubRoom("!roomId:server", "Room 1", cli);
SettingsStore.setValue("feature_wysiwyg_composer", null, SettingLevel.DEVICE, true); SettingsStore.setValue("feature_wysiwyg_composer", null, SettingLevel.DEVICE, true);
const wrapper = wrapAndRender({ room }); const wrapper = wrapAndRender({ room });
SettingsStore.setValue("feature_wysiwyg_composer", null, SettingLevel.DEVICE, false); SettingsStore.setValue("feature_wysiwyg_composer", null, SettingLevel.DEVICE, false);
expect(wrapper.find(WysiwygComposer)).toBeTruthy(); expect(wrapper.find(SendWysiwygComposer)).toBeTruthy();
}); });
}); });