Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Move SortSelect to components package (#11411)
Browse files Browse the repository at this point in the history
  • Loading branch information
opr authored Oct 26, 2023
1 parent 6ba6b3c commit 5ed4559
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 8 deletions.
2 changes: 0 additions & 2 deletions assets/js/base/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export * from './filter-reset-button';
export * from './filter-submit-button';
export * from './form';
export * from './form-token-field';
export * from './label';
export * from './load-more-button';
export * from './loading-mask';
export * from './noninteractive';
Expand All @@ -26,7 +25,6 @@ export * from './read-more';
export * from './reviews';
export * from './sidebar-layout';
export * from './snackbar-list';
export * from './sort-select';
export * from './state-input';
export * from './summary';
export * from './tabs';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import SortSelect from '@woocommerce/base-components/sort-select';
import { SortSelect } from '@woocommerce/blocks-components';

/**
* Internal dependencies
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import SortSelect from '@woocommerce/base-components/sort-select';
import { SortSelect } from '@woocommerce/blocks-components';
import type { ChangeEventHandler } from 'react';

/**
Expand Down
4 changes: 3 additions & 1 deletion assets/js/blocks/reviews/test/frontend-block.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ jest.mock( '../utils', () => ( {

jest.mock( '@woocommerce/settings', () => ( {
...jest.requireActual( '@woocommerce/settings' ),
getSetting: jest.fn().mockReturnValue( true ),
getSetting: jest
.fn()
.mockImplementation( ( setting, defaultValue ) => defaultValue ),
} ) );

/**
Expand Down
5 changes: 3 additions & 2 deletions packages/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
export { default as CheckboxList } from './checkbox-list';
export { default as FormStep } from './form-step';
export { Chip, RemovableChip } from './chip';
export { default as Label } from './label';
export { default as FormStep } from './form-step';
export { default as FormattedMonetaryAmount } from './formatted-monetary-amount';
export { default as Label } from './label';
export {
default as RadioControl,
RadioControlOption,
RadioControlOptionLayout,
} from './radio-control';
export type { RadioControlOption as RadioControlOptionType } from './radio-control/types';
export { default as RadioControlAccordion } from './radio-control-accordion';
export { default as SortSelect } from './sort-select';
export { default as Spinner } from './spinner';
export { default as Textarea } from './textarea';
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type { ChangeEventHandler } from 'react';
* Internal dependencies
*/
import './style.scss';
import Label from '../../../../../packages/components/label'; // Imported like this because importing from the components package loads the data stores unnecessarily - not a problem in the front end but would require a lot of unit test rewrites to prevent breaking tests due to incorrect mocks.
import Label from '../label'; // Imported like this because importing from the components package loads the data stores unnecessarily - not a problem in the front end but would require a lot of unit test rewrites to prevent breaking tests due to incorrect mocks.

interface SortSelectProps {
/**
Expand Down

0 comments on commit 5ed4559

Please sign in to comment.