Fix tests.
Этот коммит содержится в:
@@ -208,7 +208,7 @@ export default function SelfHostedExpansionCard(props: Props) {
|
|||||||
<br/>
|
<br/>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id='self_hosted_expansion_rhs_card_cost_per_user_breakdown'
|
id='self_hosted_expansion_rhs_card_cost_per_user_breakdown'
|
||||||
/* eslint-disable no-template-curly-in-string */
|
/* eslint-disable no-template-curly-in-string*/
|
||||||
defaultMessage='${costPerUser} x {monthsUntilExpiry} months'
|
defaultMessage='${costPerUser} x {monthsUntilExpiry} months'
|
||||||
values={{
|
values={{
|
||||||
costPerUser: getMonthlyPrice().toFixed(2),
|
costPerUser: getMonthlyPrice().toFixed(2),
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import {SelfHostedProducts, ModalIdentifiers, RecurringIntervals} from 'utils/co
|
|||||||
import {DeepPartial} from '@mattermost/types/utilities';
|
import {DeepPartial} from '@mattermost/types/utilities';
|
||||||
|
|
||||||
import SelfHostedExpansionModal, {makeInitialState, canSubmit, FormState} from './';
|
import SelfHostedExpansionModal, {makeInitialState, canSubmit, FormState} from './';
|
||||||
|
import moment from 'moment-timezone';
|
||||||
|
|
||||||
interface MockCardInputProps {
|
interface MockCardInputProps {
|
||||||
onCardInputChange: (event: {complete: boolean}) => void;
|
onCardInputChange: (event: {complete: boolean}) => void;
|
||||||
@@ -131,9 +132,9 @@ jest.mock('utils/hosted_customer', () => {
|
|||||||
const productName = SelfHostedProducts.PROFESSIONAL;
|
const productName = SelfHostedProducts.PROFESSIONAL;
|
||||||
|
|
||||||
// Licensed expiry set as 3 months from the current date (rolls over to new years).
|
// 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;
|
const monthsUntilLicenseExpiry = 3;
|
||||||
licenseExpiry.setMonth(licenseExpiry.getMonth() + monthsUntilLicenseExpiry);
|
licenseExpiry = licenseExpiry.add(monthsUntilLicenseExpiry, 'months');
|
||||||
|
|
||||||
const initialState: DeepPartial<GlobalState> = {
|
const initialState: DeepPartial<GlobalState> = {
|
||||||
views: {
|
views: {
|
||||||
@@ -164,7 +165,7 @@ const initialState: DeepPartial<GlobalState> = {
|
|||||||
license: {
|
license: {
|
||||||
Sku: productName,
|
Sku: productName,
|
||||||
Users: '50',
|
Users: '50',
|
||||||
ExpiresAt: licenseExpiry.getTime().toString(),
|
ExpiresAt: licenseExpiry.valueOf().toString(),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
cloud: {
|
cloud: {
|
||||||
@@ -362,7 +363,7 @@ describe('SelfHostedExpansionModal RHS Card', () => {
|
|||||||
|
|
||||||
const costAmount = document.getElementsByClassName('totalCostAmount')[0];
|
const costAmount = document.getElementsByClassName('totalCostAmount')[0];
|
||||||
expect(costAmount).toBeInTheDocument();
|
expect(costAmount).toBeInTheDocument();
|
||||||
expect(costAmount.innerHTML).toContain('$' + expectedTotalCost);
|
expect(costAmount).toHaveTextContent('$' + expectedTotalCost);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user