richie-education 2.25.0-b2.dev136 → 2.25.0-b2.dev138

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -123,7 +123,7 @@ describe('<DashboardCourses/>', () => {
123
123
  enrollmentsDeferred.resolve({ results: [], next: null, previous: null, count: 0 });
124
124
 
125
125
  await expectNoSpinner('Loading orders and enrollments...');
126
- expectBannerInfo('You have no enrollments nor orders yet.');
126
+ await expectBannerInfo('You have no enrollments nor orders yet.');
127
127
  expect(screen.queryByRole('button', { name: 'Load more' })).not.toBeInTheDocument();
128
128
  });
129
129
 
@@ -1,34 +1,34 @@
1
1
  import { screen, waitFor } from '@testing-library/react';
2
2
  import { BannerType, getBannerTestId } from 'components/Banner';
3
3
 
4
- export const expectBannerError = async (message: string, rootElement: ParentNode = document) => {
4
+ export const expectBannerError = (message: string, rootElement: ParentNode = document) => {
5
5
  return expectBanner(BannerType.ERROR, message, rootElement);
6
6
  };
7
- export const expectBannerInfo = async (message: string, rootElement: ParentNode = document) => {
7
+ export const expectBannerInfo = (message: string, rootElement: ParentNode = document) => {
8
8
  return expectBanner(BannerType.INFO, message, rootElement);
9
9
  };
10
10
 
11
- export const expectBanner = async (
11
+ export const expectBanner = (
12
12
  type: BannerType,
13
13
  message: string,
14
14
  rootElement: ParentNode = document,
15
15
  ) => {
16
- await waitFor(async () => {
16
+ return waitFor(async () => {
17
17
  const banner = rootElement.querySelector('.banner--' + type) as HTMLElement;
18
18
  expect(banner).not.toBeNull();
19
19
  expect(banner).toHaveTextContent(message);
20
20
  });
21
21
  };
22
22
 
23
- export const expectNoBannerError = async (message: string) => {
23
+ export const expectNoBannerError = (message: string) => {
24
24
  return expectNoBanner(BannerType.ERROR, message);
25
25
  };
26
- export const expectNoBannerInfo = async (message: string) => {
26
+ export const expectNoBannerInfo = (message: string) => {
27
27
  return expectNoBanner(BannerType.INFO, message);
28
28
  };
29
29
 
30
- export const expectNoBanner = async (type: BannerType, message: string) => {
31
- await waitFor(() => {
30
+ export const expectNoBanner = (type: BannerType, message: string) => {
31
+ return waitFor(() => {
32
32
  expect(screen.queryByTestId(getBannerTestId(message, type))).toBeNull();
33
33
  });
34
34
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "richie-education",
3
- "version": "2.25.0-b2.dev136",
3
+ "version": "2.25.0-b2.dev138",
4
4
  "description": "A CMS to build learning portals for Open Education",
5
5
  "main": "sandbox/manage.py",
6
6
  "scripts": {