|
@@ -1,7 +1,6 @@
|
|
|
import { expect } from 'chai'
|
|
import { expect } from 'chai'
|
|
|
import { fireEvent, screen, waitFor, within } from '@testing-library/react'
|
|
import { fireEvent, screen, waitFor, within } from '@testing-library/react'
|
|
|
import userEvent from '@testing-library/user-event'
|
|
import userEvent from '@testing-library/user-event'
|
|
|
-import { ChangePlan } from '../../../../../../../../../frontend/js/features/subscription/components/dashboard/states/active/change-plan/change-plan'
|
|
|
|
|
import { groupPlans, plans } from '../../../../../fixtures/plans'
|
|
import { groupPlans, plans } from '../../../../../fixtures/plans'
|
|
|
import {
|
|
import {
|
|
|
annualActiveSubscription,
|
|
annualActiveSubscription,
|
|
@@ -22,7 +21,7 @@ import {
|
|
|
} from '../../../../../../../../../frontend/js/features/subscription/data/subscription-url'
|
|
} from '../../../../../../../../../frontend/js/features/subscription/data/subscription-url'
|
|
|
import { renderActiveSubscription } from '../../../../../helpers/render-active-subscription'
|
|
import { renderActiveSubscription } from '../../../../../helpers/render-active-subscription'
|
|
|
|
|
|
|
|
-describe('<ChangePlan />', function () {
|
|
|
|
|
|
|
+describe('<ChangePlanModal />', function () {
|
|
|
let reloadStub: () => void
|
|
let reloadStub: () => void
|
|
|
const originalLocation = window.location
|
|
const originalLocation = window.location
|
|
|
const plansMetaTag = { name: 'ol-plans', value: plans }
|
|
const plansMetaTag = { name: 'ol-plans', value: plans }
|
|
@@ -42,15 +41,6 @@ describe('<ChangePlan />', function () {
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
- it('does not render the UI when showChangePersonalPlan is false', function () {
|
|
|
|
|
- window.metaAttributesCache.delete('ol-plans')
|
|
|
|
|
- const { container } = renderWithSubscriptionDashContext(<ChangePlan />, {
|
|
|
|
|
- metaTags: [plansMetaTag],
|
|
|
|
|
- })
|
|
|
|
|
-
|
|
|
|
|
- expect(container.firstChild).to.be.null
|
|
|
|
|
- })
|
|
|
|
|
-
|
|
|
|
|
it('renders the individual plans table and group plans UI', async function () {
|
|
it('renders the individual plans table and group plans UI', async function () {
|
|
|
renderActiveSubscription(annualActiveSubscription)
|
|
renderActiveSubscription(annualActiveSubscription)
|
|
|
const button = screen.getByRole('button', { name: 'Change plan' })
|
|
const button = screen.getByRole('button', { name: 'Change plan' })
|