fix threadsupport type issues in tests (#9359)
parent
3e4f3152bc
commit
8399b63e7a
|
@ -27,7 +27,7 @@ import {
|
||||||
EventType,
|
EventType,
|
||||||
} from 'matrix-js-sdk/src/matrix';
|
} from 'matrix-js-sdk/src/matrix';
|
||||||
import { ExtensibleEvent, MessageEvent, M_POLL_KIND_DISCLOSED, PollStartEvent } from 'matrix-events-sdk';
|
import { ExtensibleEvent, MessageEvent, M_POLL_KIND_DISCLOSED, PollStartEvent } from 'matrix-events-sdk';
|
||||||
import { Thread } from "matrix-js-sdk/src/models/thread";
|
import { FeatureSupport, Thread } from "matrix-js-sdk/src/models/thread";
|
||||||
import { mocked } from "jest-mock";
|
import { mocked } from "jest-mock";
|
||||||
import { act } from '@testing-library/react';
|
import { act } from '@testing-library/react';
|
||||||
|
|
||||||
|
@ -469,7 +469,7 @@ describe('MessageContextMenu', () => {
|
||||||
const eventContent = MessageEvent.from("hello");
|
const eventContent = MessageEvent.from("hello");
|
||||||
const mxEvent = new MatrixEvent(eventContent.serialize());
|
const mxEvent = new MatrixEvent(eventContent.serialize());
|
||||||
|
|
||||||
Thread.hasServerSideSupport = true;
|
Thread.hasServerSideSupport = FeatureSupport.Stable;
|
||||||
const context = {
|
const context = {
|
||||||
canSendMessages: true,
|
canSendMessages: true,
|
||||||
};
|
};
|
||||||
|
|
|
@ -25,7 +25,7 @@ import {
|
||||||
MsgType,
|
MsgType,
|
||||||
Room,
|
Room,
|
||||||
} from 'matrix-js-sdk/src/matrix';
|
} from 'matrix-js-sdk/src/matrix';
|
||||||
import { Thread } from 'matrix-js-sdk/src/models/thread';
|
import { FeatureSupport, Thread } from 'matrix-js-sdk/src/models/thread';
|
||||||
|
|
||||||
import MessageActionBar from '../../../../src/components/views/messages/MessageActionBar';
|
import MessageActionBar from '../../../../src/components/views/messages/MessageActionBar';
|
||||||
import {
|
import {
|
||||||
|
@ -388,13 +388,13 @@ describe('<MessageActionBar />', () => {
|
||||||
|
|
||||||
describe('thread button', () => {
|
describe('thread button', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
Thread.setServerSideSupport(true, false);
|
Thread.setServerSideSupport(FeatureSupport.Stable);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('when threads feature is not enabled', () => {
|
describe('when threads feature is not enabled', () => {
|
||||||
it('does not render thread button when threads does not have server support', () => {
|
it('does not render thread button when threads does not have server support', () => {
|
||||||
jest.spyOn(SettingsStore, 'getValue').mockReturnValue(false);
|
jest.spyOn(SettingsStore, 'getValue').mockReturnValue(false);
|
||||||
Thread.setServerSideSupport(false, false);
|
Thread.setServerSideSupport(FeatureSupport.None);
|
||||||
const { queryByLabelText } = getComponent({ mxEvent: alicesMessageEvent });
|
const { queryByLabelText } = getComponent({ mxEvent: alicesMessageEvent });
|
||||||
expect(queryByLabelText('Reply in thread')).toBeFalsy();
|
expect(queryByLabelText('Reply in thread')).toBeFalsy();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue