From 830ff9dea5e49eb16b563a9f896acd41b3f805ab Mon Sep 17 00:00:00 2001
From: jacobshandling <61553566+jacobshandling@users.noreply.github.com>
Date: Thu, 21 Nov 2024 09:29:24 -0800
Subject: [PATCH] UI - fix a small issue in the device user page banner logic,
add test (#24001)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
**Bug:**
**Fixed:**
- [x] Added/updated tests
- [x] Manual QA for all new/changed functionality
Co-authored-by: Jacob Shandling
---
.../DeviceUserBanners.tests.tsx | 26 ++++++++++++++++++-
.../DeviceUserBanners/DeviceUserBanners.tsx | 11 +++++---
2 files changed, 33 insertions(+), 4 deletions(-)
diff --git a/frontend/pages/hosts/details/DeviceUserPage/components/DeviceUserBanners/DeviceUserBanners.tests.tsx b/frontend/pages/hosts/details/DeviceUserPage/components/DeviceUserBanners/DeviceUserBanners.tests.tsx
index 632d9eecaf..18a57d6eeb 100644
--- a/frontend/pages/hosts/details/DeviceUserPage/components/DeviceUserBanners/DeviceUserBanners.tests.tsx
+++ b/frontend/pages/hosts/details/DeviceUserPage/components/DeviceUserBanners/DeviceUserBanners.tests.tsx
@@ -86,7 +86,31 @@ describe("Device User Banners", () => {
).toBeInTheDocument();
});
- it("renders no banner correctly", () => {
+ it("renders no banner correctly for a mac that is verifying its disk encryption", () => {
+ // setup so mdm is not enabled and configured.
+ render(
+
+ );
+
+ expect(screen.queryByText(turnOnMdmExpcetedText)).not.toBeInTheDocument();
+ expect(
+ screen.queryByText(resetNonLinuxDiskEncryptKeyExpectedText)
+ ).not.toBeInTheDocument();
+ expect(
+ screen.queryByText(resetNonLinuxDiskEncryptKeyExpectedText)
+ ).not.toBeInTheDocument();
+ });
+ it("renders no banner correctly for a mac without MDM set up", () => {
// setup so mdm is not enabled and configured.
render(