Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/pages/Plan/summary/components/PlanInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,18 @@ export const PlanInfo = () => {
const { planId } = useParams();
const { t } = useTranslation();

const { plan } = usePlan(planId);
const { plan, planComposedStatus } = usePlan(planId);

if (!plan) return null;

if (!plan.price || !plan.from_template) {
return null;
}

if (
planComposedStatus !== 'PrequotedDraft' &&
planComposedStatus !== 'PurchasableDraft'
)
return null;
return (
<WidgetSpecialCard style={{ height: 'auto' }}>
<MD
Expand Down
19 changes: 0 additions & 19 deletions tests/e2e/plan/draft_plan_info_card.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,25 +85,6 @@ test.describe('A plan with template and price', () => {
await planPage.open();
});

test('shows the info plan card with template title and price', async () => {
await expect(planPage.elements().draftPlanCardInfo().title()).toBeVisible();
await expect(
planPage.elements().draftPlanCardInfo().templateType()
).toBeVisible();
await expect(
planPage.elements().draftPlanCardInfo().startingPrice()
).toBeVisible();
await expect(
planPage.elements().draftPlanCardInfo().priceWarning()
).toBeVisible();
await expect(
planPage.elements().draftPlanCardInfo().templateTypeValue()
).toHaveText('Professional template');
await expect(
planPage.elements().draftPlanCardInfo().startingPriceValue()
).toHaveText('100 €');
});

test("it's possible to add a module, and remove and still see the plan card info", async () => {
await touchpointsModule.addModule();
await expect(touchpointsModule.elements().module()).toBeVisible();
Expand Down
Loading