Update @matrix-org/matrix-wysiwyg dependency
This commit is contained in:
parent
18c03daa86
commit
45d53d3404
9 changed files with 22 additions and 22 deletions
|
@ -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' } };
|
||||
},
|
||||
}));
|
||||
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue