@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
|
@@ -389,12 +389,14 @@ describe("Dashboard Statistics", () => {
|
|
|
389
389
|
roles,
|
|
390
390
|
quicksightPagePath: fakeQuickSightHref,
|
|
391
391
|
};
|
|
392
|
-
const {
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
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
|
|
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
|
|
425
|
+
return requestButton;
|
|
412
426
|
};
|
|
413
427
|
|
|
414
428
|
// If the feature flag is set, the button should be visible only to sysadmins.
|