Skip to content

Commit

Permalink
Updated imports of TitleManager and added withIntlConfiguration to re…
Browse files Browse the repository at this point in the history
…nders in test
  • Loading branch information
danetsao committed Nov 6, 2023
1 parent f8250ab commit 79d1e80
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
3 changes: 1 addition & 2 deletions src/views/AllCalendarView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import {
MenuSection,
Pane
} from '@folio/stripes/components';
import { IfPermission, useStripes } from '@folio/stripes/core';
import { TitleManager } from '@folio/stripes/core/index.js';
import { IfPermission, useStripes, TitleManager } from '@folio/stripes/core';
import React, { FunctionComponent, ReactNode, useRef, useState } from 'react';
import { FormattedMessage, useIntl } from 'react-intl';
import {
Expand Down
5 changes: 4 additions & 1 deletion src/views/CalendarSettings.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ import React from 'react';
import { render, screen } from '@testing-library/react';
import { SettingsProps } from '@folio/stripes/smart-components';
import CalendarSettings from './CalendarSettings';
import withIntlConfiguration from '../test/util/withIntlConfiguration';

jest.mock('@folio/stripes-smart-components/lib/Settings', () => jest.fn().mockReturnValue('Settings'));

const renderCalendarSettings = () => render(<CalendarSettings {...({} as unknown as SettingsProps)} />);
const renderCalendarSettings = () => render(withIntlConfiguration(
<CalendarSettings {...({} as unknown as SettingsProps)} />
));

describe('Calender Settings', () => {
it('should render Calendar Settings', () => {
Expand Down
3 changes: 1 addition & 2 deletions src/views/CalendarSettings.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { ErrorBoundary } from '@folio/stripes/components';
import { Settings, SettingsProps } from '@folio/stripes/smart-components';
import React, { FunctionComponent } from 'react';
import { FormattedMessage, useIntl } from 'react-intl';
import { TitleManager } from '@folio/stripes/core/index.js';
import { FormattedMessage, useIntl, TitleManager } from 'react-intl';
import AllCalendarView from './AllCalendarView';
import CurrentAssignmentView from './CurrentAssignmentView';
import MonthlyCalendarPickerView from './MonthlyCalendarPickerView';
Expand Down
2 changes: 1 addition & 1 deletion src/views/CreateEditCalendarLayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
PaneFooter,
Paneset,
} from '@folio/stripes/components';
import { TitleManager } from '@folio/stripes/core/index.js';
import { TitleManager } from '@folio/stripes/core';
import React, { FunctionComponent, useState } from 'react';
import { FormattedMessage, useIntl } from 'react-intl';
import DataRepository from '../data/DataRepository';
Expand Down
3 changes: 1 addition & 2 deletions src/views/CurrentAssignmentView.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Button, LoadingPane, Pane, PaneMenu } from '@folio/stripes/components';
import { IfPermission } from '@folio/stripes/core';
import { TitleManager } from '@folio/stripes/core/index.js';
import { IfPermission, TitleManager } from '@folio/stripes/core';
import React, { FunctionComponent, ReactNode, useRef } from 'react';
import { FormattedMessage, useIntl } from 'react-intl';
import {
Expand Down
2 changes: 1 addition & 1 deletion src/views/MonthlyCalendarPickerView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
NavListSection,
Pane
} from '@folio/stripes/components';
import { TitleManager } from '@folio/stripes/core/index.js';
import { TitleManager } from '@folio/stripes/core';
import classNames from 'classnames';
import React, {
FunctionComponent,
Expand Down

0 comments on commit 79d1e80

Please sign in to comment.