Update @matrix-org/matrix-wysiwyg dependency

This commit is contained in:
Florian Duros 2022-11-14 11:45:31 +01:00
parent 18c03daa86
commit 45d53d3404
No known key found for this signature in database
GPG key ID: 9700AA5870258A0B
9 changed files with 22 additions and 22 deletions

View file

@ -47,7 +47,7 @@ import { SendWysiwygComposer } from "../../../../src/components/views/rooms/wysi
jest.mock("@matrix-org/matrix-wysiwyg", () => ({
useWysiwyg: () => {
return { ref: { current: null }, isWysiwygReady: true, wysiwyg: { clear: () => void 0 },
formattingStates: { bold: 'enabled', italic: 'enabled', underline: 'enabled', strikeThrough: 'enabled' } };
actionStates: { bold: 'enabled', italic: 'enabled', underline: 'enabled', strikeThrough: 'enabled' } };
},
}));

View file

@ -45,7 +45,7 @@ jest.mock("@matrix-org/matrix-wysiwyg", () => ({
content: mockContent,
isWysiwygReady: true,
wysiwyg: { clear: mockClear },
formattingStates: {
actionStates: {
bold: 'enabled',
italic: 'enabled',
underline: 'enabled',

View file

@ -41,7 +41,7 @@ jest.mock("@matrix-org/matrix-wysiwyg", () => ({
content: '<b>html</b>',
isWysiwygReady: true,
wysiwyg: { clear: mockClear },
formattingStates: {
actionStates: {
bold: 'enabled',
italic: 'enabled',
underline: 'enabled',

View file

@ -29,7 +29,7 @@ describe('FormattingButtons', () => {
strikeThrough: jest.fn(),
} as any;
const formattingStates = {
const actionStates = {
bold: 'reversed',
italic: 'reversed',
underline: 'enabled',
@ -42,7 +42,7 @@ describe('FormattingButtons', () => {
it('Should have the correspond CSS classes', () => {
// When
render(<FormattingButtons composer={wysiwyg} formattingStates={formattingStates} />);
render(<FormattingButtons composer={wysiwyg} actionStates={actionStates} />);
// Then
expect(screen.getByLabelText('Bold')).toHaveClass('mx_FormattingButtons_active');
@ -53,7 +53,7 @@ describe('FormattingButtons', () => {
it('Should call wysiwyg function on button click', () => {
// When
render(<FormattingButtons composer={wysiwyg} formattingStates={formattingStates} />);
render(<FormattingButtons composer={wysiwyg} actionStates={actionStates} />);
screen.getByLabelText('Bold').click();
screen.getByLabelText('Italic').click();
screen.getByLabelText('Underline').click();
@ -69,7 +69,7 @@ describe('FormattingButtons', () => {
it('Should display the tooltip on mouse over', async () => {
// When
const user = userEvent.setup();
render(<FormattingButtons composer={wysiwyg} formattingStates={formattingStates} />);
render(<FormattingButtons composer={wysiwyg} actionStates={actionStates} />);
await user.hover(screen.getByLabelText('Bold'));
// Then

View file

@ -35,7 +35,7 @@ jest.mock("@matrix-org/matrix-wysiwyg", () => ({
content: '<b>html</b>',
isWysiwygReady: true,
wysiwyg: { clear: () => void 0 },
formattingStates: {
actionStates: {
bold: 'enabled',
italic: 'enabled',
underline: 'enabled',