Skip to content
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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Change history for ui-circulation-log

## In progress
## [6.1.0] In progress

* Add translations for use-at-location actions. Refs UICIRCLOG-180.
* Add loan-action filter options In Use and Held. Refs UICIRCLOG-181.
* Migrate jest to use `@folio/jest-config-stripes`. Refs UICIRCLOG-182.

## 6.0.2 (https://github.com/folio-org/ui-circulation-log/tree/v6.0.2) (2025-11-04)
[Full Changelog](https://github.com/folio-org/ui-circulation-log/compare/v6.0.1...v6.0.2)
Expand Down
13 changes: 3 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@folio/circulation-log",
"version": "6.0.2",
"version": "6.1.0",
"description": "Description for circulation logs",
"main": "index.js",
"repository": "",
Expand Down Expand Up @@ -91,20 +91,13 @@
"@folio/eslint-config-stripes": "^8.0.0",
"@folio/stripes": "^10.0.0",
"@folio/stripes-cli": "^4.0.0",
"@testing-library/jest-dom": "^5.11.1",
"@testing-library/react": "^11.0.2",
"@testing-library/react-hooks": "^5.1.0",
"@testing-library/user-event": "^12.8.3",
"babel-jest": "^29.0.0",
"core-js": "^3.6.1",
"eslint": "^6.2.1",
"eslint-plugin-filenames": "^1.3.2",
"eslint-plugin-jest": "^24.0.0",
"faker": "^4.1.0",
"history": "^4.10.1",
"identity-obj-proxy": "^3.0.0",
"jest": "^29.0.0",
"jest-css-modules": "^2.1.0",
"jest-junit": "^11.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-intl": "^7.1.5",
Expand All @@ -115,7 +108,7 @@
"testing-library-selector": "^0.2.1"
},
"dependencies": {
"@folio/stripes-acq-components": "~7.0.0",
"@folio/stripes-acq-components": "~7.1.0",
"lodash": "^4.17.5",
"prop-types": "^15.5.10",
"query-string": "^6.1.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import React from 'react';
import { MemoryRouter } from 'react-router-dom';
import { render, screen } from '@testing-library/react';
import {
render,
screen,
waitFor,
} from '@folio/jest-config-stripes/testing-library/react';
import { byRole } from 'testing-library-selector';

import {
Expand Down Expand Up @@ -51,10 +55,10 @@ describe('Event Actions', () => {
const menuItem = byRole('menuitem', { name: /loanDetails/ });
const url = `/users/${props.referenceIds.userId}/loans/view/${props.items[0].loanId}`;

it('is shown when available', () => {
it('is shown when available', async () => {
renderAndOpenTheActionsMenu(props);

expect(menuItem.get()).toBeVisible();
await waitFor(() => expect(menuItem.get()).toBeVisible());
expect(menuItem.get()).toHaveAttribute('href', url);
});

Expand Down Expand Up @@ -107,10 +111,10 @@ describe('Event Actions', () => {
const menuItem = byRole('menuitem', { name: /feeDetails/ });
const url = `/users/${props.referenceIds.userId}/accounts/view/${props.referenceIds.feeFineId}`;

it('is shown when available', () => {
it('is shown when available', async () => {
renderAndOpenTheActionsMenu(props);

expect(menuItem.get()).toBeVisible();
await waitFor(() => expect(menuItem.get()).toBeVisible());
expect(menuItem.get()).toHaveAttribute('href', url);
});

Expand All @@ -132,10 +136,10 @@ describe('Event Actions', () => {
const menuItem = byRole('menuitem', { name: /userDetails/ });
const url = `/users/view/${props.referenceIds.userId}`;

it('is shown when available', () => {
it('is shown when available', async () => {
renderAndOpenTheActionsMenu(props);

expect(menuItem.get()).toBeVisible();
await waitFor(() => expect(menuItem.get()).toBeVisible());
expect(menuItem.get()).toHaveAttribute('href', url);
});

Expand All @@ -157,10 +161,10 @@ describe('Event Actions', () => {
const menuItem = byRole('menuitem', { name: /requestDetails/ });
const url = `/requests/view/${props.referenceIds.requestId}`;

it('is shown when available', () => {
it('is shown when available', async () => {
renderAndOpenTheActionsMenu(props);

expect(menuItem.get()).toBeVisible();
await waitFor(() => expect(menuItem.get()).toBeVisible());
expect(menuItem.get()).toHaveAttribute('href', url);
});

Expand All @@ -182,10 +186,10 @@ describe('Event Actions', () => {
const menuItem = byRole('menuitem', { name: /noticePolicyDetails/ });
const url = `/settings/circulation/notice-policies/${props.referenceIds.noticePolicyId}`;

it('is shown when available', () => {
it('is shown when available', async () => {
renderAndOpenTheActionsMenu(props);

expect(menuItem.get()).toBeVisible();
await waitFor(() => expect(menuItem.get()).toBeVisible());
expect(menuItem.get()).toHaveAttribute('href', url);
});

Expand All @@ -207,10 +211,10 @@ describe('Event Actions', () => {
const menuItem = byRole('menuitem', { name: /templateDetails/ });
const url = `/settings/circulation/patron-notices/${props.referenceIds.templateId}`;

it('is shown when available', () => {
it('is shown when available', async () => {
renderAndOpenTheActionsMenu(props);

expect(menuItem.get()).toBeVisible();
await waitFor(() => expect(menuItem.get()).toBeVisible());
expect(menuItem.get()).toHaveAttribute('href', url);
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import { render } from '@testing-library/react';

import { render } from '@folio/jest-config-stripes/testing-library/react';

import '@folio/stripes-acq-components/test/jest/__mock__';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import {
render,
fireEvent,
} from '@testing-library/react';
} from '@folio/jest-config-stripes/testing-library/react';

import '@folio/stripes-acq-components/test/jest/__mock__';

Expand Down
6 changes: 5 additions & 1 deletion src/CirculationLogList/CirculationLogList.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import React from 'react';
import { render, screen, within } from '@testing-library/react';
import {
render,
screen,
within,
} from '@folio/jest-config-stripes/testing-library/react';

import { CirculationLogList } from './CirculationLogList';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import { render } from '@testing-library/react';
import user from '@testing-library/user-event';

import { render } from '@folio/jest-config-stripes/testing-library/react';
import user from '@folio/jest-config-stripes/testing-library/user-event';

import '@folio/stripes-acq-components/test/jest/__mock__';

Expand All @@ -27,14 +28,14 @@ describe('CirculationLogListActions', () => {
});
});

it('should request export when Export action is pressed', () => {
it('should request export when Export action is pressed', async () => {
const requestExport = jest.fn();

useCirculationLogExport.mockReturnValue({ requestExport });

const { getByTestId } = renderCirculationLogListActions({ logEventsCount: 10 });

user.click(getByTestId('export-results'));
await user.click(getByTestId('export-results'));

expect(requestExport).toHaveBeenCalled();
});
Expand Down

This file was deleted.

Loading