File tree Expand file tree Collapse file tree 5 files changed +68
-0
lines changed
translations/stripes-acq-components Expand file tree Collapse file tree 5 files changed +68
-0
lines changed Original file line number Diff line number Diff line change
1
+ import PropTypes from 'prop-types' ;
2
+ import { FormattedMessage } from 'react-intl' ;
3
+
4
+ import {
5
+ Button ,
6
+ Icon ,
7
+ } from '@folio/stripes/components' ;
8
+
9
+ export const GroupByOrgActionMenuItem = ( {
10
+ onClick,
11
+ } ) => {
12
+ return (
13
+ < Button
14
+ data-testid = "group-by-org-button"
15
+ buttonStyle = "dropdownItem"
16
+ onClick = { onClick }
17
+ >
18
+ < Icon icon = "house" >
19
+ < FormattedMessage id = "stripes-acq-components.claiming.action.groupByOrganization" />
20
+ </ Icon >
21
+ </ Button >
22
+ ) ;
23
+ } ;
24
+
25
+ GroupByOrgActionMenuItem . propTypes = {
26
+ onClick : PropTypes . func . isRequired ,
27
+ } ;
Original file line number Diff line number Diff line change
1
+ import {
2
+ render ,
3
+ screen ,
4
+ } from '@testing-library/react' ;
5
+ import userEvent from '@testing-library/user-event' ;
6
+
7
+ import { GroupByOrgActionMenuItem } from './GroupByOrgActionMenuItem' ;
8
+
9
+ const defaultProps = {
10
+ onClick : jest . fn ( ) ,
11
+ } ;
12
+
13
+ const renderComponent = ( props = { } ) => render (
14
+ < GroupByOrgActionMenuItem
15
+ { ...defaultProps }
16
+ { ...props }
17
+ /> ,
18
+ ) ;
19
+
20
+ describe ( 'GroupByOrgActionMenuItem' , ( ) => {
21
+ afterEach ( ( ) => {
22
+ jest . clearAllMocks ( ) ;
23
+ } ) ;
24
+
25
+ it ( 'should render the button' , ( ) => {
26
+ renderComponent ( ) ;
27
+
28
+ expect ( screen . getByTestId ( 'group-by-org-button' ) ) . toBeInTheDocument ( ) ;
29
+ } ) ;
30
+
31
+ it ( 'should call onClick when button is clicked' , async ( ) => {
32
+ renderComponent ( ) ;
33
+
34
+ await userEvent . click ( screen . getByTestId ( 'group-by-org-button' ) ) ;
35
+
36
+ expect ( defaultProps . onClick ) . toHaveBeenCalled ( ) ;
37
+ } ) ;
38
+ } ) ;
Original file line number Diff line number Diff line change
1
+ export { GroupByOrgActionMenuItem } from './GroupByOrgActionMenuItem' ;
Original file line number Diff line number Diff line change 1
1
export { DelayClaimActionMenuItem } from './DelayClaimActionMenuItem' ;
2
2
export { MarkUnreceivableActionMenuItem } from './MarkUnreceivableActionMenuItem' ;
3
3
export { SendClaimActionMenuItem } from './SendClaimActionMenuItem' ;
4
+ export { GroupByOrgActionMenuItem } from './GroupByOrgActionMenuItem' ;
Original file line number Diff line number Diff line change 144
144
"receiving.itemStatus.Order closed" : " Order closed" ,
145
145
"receiving.itemStatus.Undefined" : " Undefined" ,
146
146
147
+ "claiming.action.groupByOrganization" : " Group by organization" ,
147
148
"claiming.action.sendClaim" : " Send claim" ,
148
149
"claiming.action.delayClaim" : " Delay claim" ,
149
150
"claiming.action.unreceivable" : " Unreceivable" ,
You can’t perform that action at this time.
0 commit comments