diff --git a/webapp/channels/src/components/self_hosted_expansion_modal/expansion_card.tsx b/webapp/channels/src/components/self_hosted_expansion_modal/expansion_card.tsx
index 47ecfa49aa..caa3afb2d9 100644
--- a/webapp/channels/src/components/self_hosted_expansion_modal/expansion_card.tsx
+++ b/webapp/channels/src/components/self_hosted_expansion_modal/expansion_card.tsx
@@ -208,7 +208,7 @@ export default function SelfHostedExpansionCard(props: Props) {
void;
@@ -131,9 +132,9 @@ jest.mock('utils/hosted_customer', () => {
const productName = SelfHostedProducts.PROFESSIONAL;
// Licensed expiry set as 3 months from the current date (rolls over to new years).
-const licenseExpiry = new Date();
+let licenseExpiry = moment()
const monthsUntilLicenseExpiry = 3;
-licenseExpiry.setMonth(licenseExpiry.getMonth() + monthsUntilLicenseExpiry);
+licenseExpiry = licenseExpiry.add(monthsUntilLicenseExpiry, 'months');
const initialState: DeepPartial = {
views: {
@@ -164,7 +165,7 @@ const initialState: DeepPartial = {
license: {
Sku: productName,
Users: '50',
- ExpiresAt: licenseExpiry.getTime().toString(),
+ ExpiresAt: licenseExpiry.valueOf().toString(),
},
},
cloud: {
@@ -362,7 +363,7 @@ describe('SelfHostedExpansionModal RHS Card', () => {
const costAmount = document.getElementsByClassName('totalCostAmount')[0];
expect(costAmount).toBeInTheDocument();
- expect(costAmount.innerHTML).toContain('$' + expectedTotalCost);
+ expect(costAmount).toHaveTextContent('$' + expectedTotalCost);
});
});