Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump the matrix-widget-toolkit group with 4 updates #332

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions e2e/src/pages/meetingsWidgetPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ export class MeetingsWidgetPage {
}

async switchView(view: CalendarView) {
await this.widget.getByRole('button', { name: /^View/ }).click();
await this.widget.getByRole('combobox', { name: /^View/ }).click();
await this.widget
.getByRole('option', { name: new RegExp(`^${view}$`, 'i') })
.click();
}

async waitForCalendarView(view: CalendarView) {
await this.widget
.getByRole('button', { name: new RegExp(`^View ${view}$`, 'i') })
.getByRole('combobox', { name: new RegExp(`^View ${view}$`, 'i') })
.isVisible();
}

Expand Down
6 changes: 4 additions & 2 deletions e2e/src/pages/scheduleMeetingWidgetPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ export class ScheduleMeetingWidgetPage {
async selectRecurrence(
name: 'no repetition' | 'daily' | 'weekly' | 'montly' | 'yearly' | 'custom',
) {
await this.widget.getByRole('button', { name: /^Repeat meeting/ }).click();
await this.widget
.getByRole('combobox', { name: /^Repeat meeting/ })
.click();
await this.widget
.getByRole('listbox', { name: 'Repeat meeting' })
.getByRole('option', { name })
Expand All @@ -134,7 +136,7 @@ export class ScheduleMeetingWidgetPage {

async selectRecurrenceFrequency(name: 'days' | 'weeks' | 'months' | 'years') {
await this.customRecurrenceRuleGroup
.getByRole('button', { name: /^Repeat/ })
.getByRole('combobox', { name: /^Repeat/ })
.click();
await this.widget
.getByRole('listbox', { name: 'Repeat' })
Expand Down
4 changes: 2 additions & 2 deletions matrix-meetings-bot/src/service/WelcomeWorkflowService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import { Inject, Injectable, Logger } from '@nestjs/common';
import i18next from 'i18next';
import i18next, { TOptions } from 'i18next';
import {
MatrixClient,
MembershipEventContent,
Expand Down Expand Up @@ -47,7 +47,7 @@ interface IPrivateRoomContext {
}

// variables for i18n
interface TranslationContext {
interface TranslationContext extends TOptions {
locale?: string; // locale of the message ('en', 'de')
roomName?: string; // name of the room that will display the message
roomId?: string; // roomId of the room that will display the message
Expand Down
8 changes: 4 additions & 4 deletions matrix-meetings-widget/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
"@fullcalendar/interaction": "^6.1.9",
"@fullcalendar/react": "^6.1.9",
"@fullcalendar/timegrid": "^6.1.9",
"@matrix-widget-toolkit/api": "^3.2.1",
"@matrix-widget-toolkit/mui": "^1.1.5",
"@matrix-widget-toolkit/api": "^3.2.2",
"@matrix-widget-toolkit/mui": "^1.1.6",
"@matrix-widget-toolkit/react": "^1.0.5",
"@mui/icons-material": "^5.11.16",
"@mui/lab": "^5.0.0-alpha.140",
"@mui/lab": "^5.0.0-alpha.149",
"@mui/material": "^5.13.4",
"@mui/x-date-pickers": "^6.16.2",
"@mui/utils": "^5.14.13",
Expand All @@ -42,7 +42,7 @@
},
"devDependencies": {
"@craco/craco": "^7.1.0",
"@matrix-widget-toolkit/testing": "^2.3.1",
"@matrix-widget-toolkit/testing": "^2.3.2",
"@testing-library/jest-dom": "^6.1.2",
"@testing-library/react": "^12.1.5",
"@testing-library/react-hooks": "^8.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ describe('<MeetingsNavigation/>', () => {
wrapper: Wrapper,
});

expect(
screen.getByRole('combobox', { name: 'View', description: '' }),
).toHaveTextContent('List');
await userEvent.click(
screen.getByRole('button', { name: 'View List', description: '' }),
screen.getByRole('combobox', { name: 'View', description: '' }),
);

const listbox = screen.getByRole('listbox', { name: 'View' });
Expand All @@ -63,7 +66,7 @@ describe('<MeetingsNavigation/>', () => {
{ wrapper: Wrapper },
);

await userEvent.click(screen.getByRole('button', { name: 'View List' }));
await userEvent.click(screen.getByRole('combobox', { name: 'View' }));

expect(await axe(container)).toHaveNoViolations();
});
Expand All @@ -76,7 +79,7 @@ describe('<MeetingsNavigation/>', () => {
{ wrapper: Wrapper },
);

await userEvent.click(screen.getByRole('button', { name: 'View List' }));
await userEvent.click(screen.getByRole('combobox', { name: 'View' }));

expect(await axe(container)).toHaveNoViolations();
});
Expand All @@ -90,7 +93,10 @@ describe('<MeetingsNavigation/>', () => {
wrapper: Wrapper,
});

await userEvent.click(screen.getByRole('button', { name: 'View Week' }));
expect(screen.getByRole('combobox', { name: 'View' })).toHaveTextContent(
'Week',
);
await userEvent.click(screen.getByRole('combobox', { name: 'View' }));
await userEvent.click(screen.getByRole('option', { name: 'Month' }));

expect(onViewChange).toHaveBeenLastCalledWith('month');
Expand All @@ -104,8 +110,8 @@ describe('<MeetingsNavigation/>', () => {
});

await userEvent.click(
screen.getByRole('button', {
name: 'View List',
screen.getByRole('combobox', {
name: 'View',
description: 'Increase widget width to enable more views.',
}),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ describe('<MeetingsPanel/>', () => {
it('should have no accessibility violations, if day view', async () => {
const { container } = render(<MeetingsPanel />, { wrapper: Wrapper });

await userEvent.click(screen.getByRole('button', { name: 'View List' }));
await userEvent.click(screen.getByRole('combobox', { name: 'View' }));
await userEvent.click(screen.getByRole('option', { name: 'Day' }));

expect(await screen.findByText('An important meeting')).toBeInTheDocument();
Expand All @@ -239,7 +239,7 @@ describe('<MeetingsPanel/>', () => {
it('should have no accessibility violations, if work week view', async () => {
const { container } = render(<MeetingsPanel />, { wrapper: Wrapper });

await userEvent.click(screen.getByRole('button', { name: 'View List' }));
await userEvent.click(screen.getByRole('combobox', { name: 'View' }));
await userEvent.click(screen.getByRole('option', { name: 'Work Week' }));

expect(await screen.findByText('An important meeting')).toBeInTheDocument();
Expand All @@ -258,7 +258,7 @@ describe('<MeetingsPanel/>', () => {
it('should have no accessibility violations, if week view', async () => {
const { container } = render(<MeetingsPanel />, { wrapper: Wrapper });

await userEvent.click(screen.getByRole('button', { name: 'View List' }));
await userEvent.click(screen.getByRole('combobox', { name: 'View' }));
await userEvent.click(screen.getByRole('option', { name: 'Week' }));

expect(await screen.findByText('An important meeting')).toBeInTheDocument();
Expand All @@ -277,7 +277,7 @@ describe('<MeetingsPanel/>', () => {
it('should have no accessibility violations, if month view', async () => {
const { container } = render(<MeetingsPanel />, { wrapper: Wrapper });

await userEvent.click(screen.getByRole('button', { name: 'View List' }));
await userEvent.click(screen.getByRole('combobox', { name: 'View' }));
await userEvent.click(screen.getByRole('option', { name: 'Month' }));

expect(await screen.findByText('An important meeting')).toBeInTheDocument();
Expand Down Expand Up @@ -318,9 +318,9 @@ describe('<MeetingsPanel/>', () => {

expect(screen.getByLabelText('Search')).toBeInTheDocument();

expect(
screen.getByRole('button', { name: 'View List' }),
).toBeInTheDocument();
expect(screen.getByRole('combobox', { name: 'View' })).toHaveTextContent(
'List',
);

expect(
await screen.findByRole('listitem', { name: /an important meeting/i }),
Expand All @@ -330,7 +330,7 @@ describe('<MeetingsPanel/>', () => {
it('should render the day view', async () => {
render(<MeetingsPanel />, { wrapper: Wrapper });

await userEvent.click(screen.getByRole('button', { name: 'View List' }));
await userEvent.click(screen.getByRole('combobox', { name: 'View' }));
await userEvent.click(screen.getByRole('option', { name: 'Day' }));

expect(screen.getAllByRole('gridcell')).toHaveLength(1);
Expand All @@ -348,12 +348,12 @@ describe('<MeetingsPanel/>', () => {

render(<MeetingsPanel />, { wrapper: Wrapper });

await userEvent.click(screen.getByRole('button', { name: 'View List' }));
await userEvent.click(screen.getByRole('combobox', { name: 'View' }));
await userEvent.click(screen.getByRole('option', { name: 'Month' }));

expect(
screen.getByRole('button', { name: 'View Month' }),
).toBeInTheDocument();
expect(screen.getByRole('combobox', { name: 'View' })).toHaveTextContent(
'Month',
);

expect(localStorage.getItem(localStorageKey)).toMatch('month');
});
Expand All @@ -364,9 +364,9 @@ describe('<MeetingsPanel/>', () => {

render(<MeetingsPanel />, { wrapper: Wrapper });

expect(
screen.getByRole('button', { name: 'View Month' }),
).toBeInTheDocument();
expect(screen.getByRole('combobox', { name: 'View' })).toHaveTextContent(
'Month',
);
});

it('should fallback to list view when reading invalid value from localStorage', async () => {
Expand All @@ -375,15 +375,15 @@ describe('<MeetingsPanel/>', () => {

render(<MeetingsPanel />, { wrapper: Wrapper });

expect(
screen.getByRole('button', { name: 'View List' }),
).toBeInTheDocument();
expect(screen.getByRole('combobox', { name: 'View' })).toHaveTextContent(
'List',
);
});

it('should render the work week view', async () => {
render(<MeetingsPanel />, { wrapper: Wrapper });

await userEvent.click(screen.getByRole('button', { name: 'View List' }));
await userEvent.click(screen.getByRole('combobox', { name: 'View' }));
await userEvent.click(screen.getByRole('option', { name: 'Work Week' }));

expect(screen.getAllByRole('gridcell')).toHaveLength(5);
Expand All @@ -399,7 +399,7 @@ describe('<MeetingsPanel/>', () => {
it('should render the week view', async () => {
render(<MeetingsPanel />, { wrapper: Wrapper });

await userEvent.click(screen.getByRole('button', { name: 'View List' }));
await userEvent.click(screen.getByRole('combobox', { name: 'View' }));
await userEvent.click(screen.getByRole('option', { name: 'Week' }));

expect(screen.getAllByRole('gridcell')).toHaveLength(7);
Expand All @@ -415,7 +415,7 @@ describe('<MeetingsPanel/>', () => {
it('should render the month view', async () => {
render(<MeetingsPanel />, { wrapper: Wrapper });

await userEvent.click(screen.getByRole('button', { name: 'View List' }));
await userEvent.click(screen.getByRole('combobox', { name: 'View' }));
await userEvent.click(screen.getByRole('option', { name: 'Month' }));

expect(screen.getAllByRole('gridcell')).toHaveLength(5 * 7);
Expand Down Expand Up @@ -462,7 +462,7 @@ describe('<MeetingsPanel/>', () => {

render(<MeetingsPanel />, { wrapper: Wrapper });

await userEvent.click(screen.getByRole('button', { name: 'View List' }));
await userEvent.click(screen.getByRole('combobox', { name: 'View' }));
await userEvent.click(screen.getByRole('option', { name: 'Month' }));

expect(screen.getAllByRole('gridcell')).toHaveLength(5 * 7);
Expand Down Expand Up @@ -491,7 +491,7 @@ describe('<MeetingsPanel/>', () => {
it('should keep the month when switching from month to week to month, if the first week of the month starts in the previous month', async () => {
render(<MeetingsPanel />, { wrapper: Wrapper });

await userEvent.click(screen.getByRole('button', { name: 'View List' }));
await userEvent.click(screen.getByRole('combobox', { name: 'View' }));
await userEvent.click(screen.getByRole('option', { name: 'Month' }));

expect(
Expand All @@ -500,7 +500,7 @@ describe('<MeetingsPanel/>', () => {
}),
).toHaveTextContent('March 2022');

await userEvent.click(screen.getByRole('button', { name: 'View Month' }));
await userEvent.click(screen.getByRole('combobox', { name: 'View' }));
await userEvent.click(screen.getByRole('option', { name: 'Week' }));

expect(
Expand All @@ -509,7 +509,7 @@ describe('<MeetingsPanel/>', () => {
}),
).toHaveTextContent('Mar 6 – 12, 2022');

await userEvent.click(screen.getByRole('button', { name: 'View Week' }));
await userEvent.click(screen.getByRole('combobox', { name: 'View' }));
await userEvent.click(screen.getByRole('option', { name: 'Month' }));

expect(
Expand Down Expand Up @@ -603,7 +603,7 @@ describe('<MeetingsPanel/>', () => {
screen.findByRole('listitem', { name: /an important meeting/i }),
).resolves.toBeInTheDocument();

await userEvent.click(screen.getByRole('button', { name: 'View List' }));
await userEvent.click(screen.getByRole('combobox', { name: 'View' }));
await userEvent.click(screen.getByRole('option', { name: 'Day' }));

expect(screen.getAllByRole('gridcell')).toHaveLength(1);
Expand Down Expand Up @@ -672,7 +672,7 @@ describe('<MeetingsPanel/>', () => {
it('should filter the meetings for day view via search', async () => {
render(<MeetingsPanel />, { wrapper: Wrapper });

await userEvent.click(screen.getByRole('button', { name: 'View List' }));
await userEvent.click(screen.getByRole('combobox', { name: 'View' }));
await userEvent.click(screen.getByRole('option', { name: 'Day' }));

expect(screen.getAllByRole('gridcell')).toHaveLength(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ describe('<MeetingsToolbar/>', () => {

expect(screen.getByRole('textbox', { name: 'Search' })).toBeInTheDocument();

expect(
screen.getByRole('button', { name: 'View Day' }),
).toBeInTheDocument();
expect(screen.getByRole('combobox', { name: 'View' })).toHaveTextContent(
'Day',
);
});

it('should have no accessibility violations', async () => {
Expand Down
Loading