@thepalaceproject/circulation-admin 1.22.0-post.6 → 1.22.0-post.8

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.
package/package.json CHANGED
@@ -150,5 +150,5 @@
150
150
  "*.{js,jsx,ts,tsx,css,md}": "prettier --write",
151
151
  "*.{js,css,md}": "prettier --write"
152
152
  },
153
- "version": "1.22.0-post.6"
153
+ "version": "1.22.0-post.8"
154
154
  }
@@ -389,12 +389,14 @@ describe("Dashboard Statistics", () => {
389
389
  roles,
390
390
  quicksightPagePath: fakeQuickSightHref,
391
391
  };
392
- const { container, getByRole, queryByRole } = renderWithProviders(
393
- <Stats library={sampleLibraryKey} />,
394
- {
395
- contextProviderProps,
396
- }
397
- );
392
+ const {
393
+ container,
394
+ getByRole,
395
+ queryByRole,
396
+ queryByText,
397
+ } = renderWithProviders(<Stats library={sampleLibraryKey} />, {
398
+ contextProviderProps,
399
+ });
398
400
 
399
401
  // We should always render a Usage reports group when a library is specified.
400
402
  getByRole("heading", {
@@ -404,11 +406,23 @@ describe("Dashboard Statistics", () => {
404
406
  const usageReportLink = getByRole("link", { name: /View Usage/i });
405
407
  expect(usageReportLink).toHaveAttribute("href", fakeQuickSightHref);
406
408
 
407
- const result = queryByRole("button", { name: /Request Report/i });
409
+ const requestButton = queryByRole("button", {
410
+ name: /Request Report/i,
411
+ });
412
+ const blurb = queryByText(
413
+ /These reports provide up-to-date data on both inventory and holds/i
414
+ );
415
+
416
+ // The inventory report blurb should be visible only when the button is.
417
+ if (requestButton) {
418
+ expect(blurb).not.toBeNull();
419
+ } else {
420
+ expect(blurb).toBeNull();
421
+ }
408
422
 
409
423
  // Clean up the container after each render.
410
424
  document.body.removeChild(container);
411
- return result;
425
+ return requestButton;
412
426
  };
413
427
 
414
428
  // If the feature flag is set, the button should be visible only to sysadmins.