Skip to content

Commit

Permalink
Merge pull request #752 from danskernesdigitalebibliotek/remove-unuse…
Browse files Browse the repository at this point in the history
…d-elements-from-user-me-fees

Remove unused elements from user me fees
  • Loading branch information
Adamik10 authored Dec 6, 2023
2 parents 4e3d883 + 74ea0fb commit fc44b61
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 169 deletions.
12 changes: 4 additions & 8 deletions src/apps/fee-list/FeeList.dev.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,12 @@ export default {
defaultValue: "https://unsplash.com/photos/JDzoTGfoogA", // Open source image of an adventurous duck
control: { type: "text" }
},
unpaidFeesText: {
defaultValue: "Unsettled debt",
unpaidFeesFirstHeadlineText: {
defaultValue: "Unsettled debt 1",
control: { type: "text" }
},
prePaymentTypeChangeDateText: {
defaultValue: "BEFORE 27/10 2020",
control: { type: "text" }
},
postPaymentTypeChangeDateText: {
defaultValue: "AFTER 27/10 2020",
unpaidFeesSecondHeadlineText: {
defaultValue: "Unsettled debt 2",
control: { type: "text" }
},
alreadyPaidText: {
Expand Down
5 changes: 2 additions & 3 deletions src/apps/fee-list/FeeList.entry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ export interface FeeListProps {
viewFeesAndCompensationRatesText: string;
etAlText: string;
viewFeesAndCompensationRatesUrl: string;
unpaidFeesText: string;
prePaymentTypeChangeDateText: string;
postPaymentTypeChangeDateText: string;
unpaidFeesFirstHeadlineText: string;
unpaidFeesSecondHeadlineText: string;
alreadyPaidText: string;
feePaymentModalHeaderText: string;
feePaymentModalBodyText: string;
Expand Down
16 changes: 2 additions & 14 deletions src/apps/fee-list/FeeList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,29 +128,17 @@ const FeeList: FC = () => {
)}
<List
dataCy="fee-list-before"
listHeader={
<>
{t("unpaidFeesText")} -<span>&nbsp;</span>
<b>{t("prePaymentTypeChangeDateText")}</b>
</>
}
listHeader={t("unpaidFeesFirstHeadlineText")}
openDetailsModalClickEvent={openDetailsModalClickEvent}
fees={itemsPrePaymentChange}
hideCheckbox={false}
totalText={t("totalText", {
placeholders: { "@total": totalFeePrePaymentChange }
})}
/>
<List
listHeader={
<>
{t("unpaidFeesText")} -<span>&nbsp;</span>
<b>{t("postPaymentTypeChangeDateText")}</b>
</>
}
listHeader={t("unpaidFeesSecondHeadlineText")}
dataCy="fee-list-after"
openDetailsModalClickEvent={openDetailsModalClickEvent}
hideCheckbox
fees={itemsPostPaymentChange}
totalText={t("totalText", {
placeholders: { "@total": totalFeePostPaymentChange }
Expand Down
44 changes: 7 additions & 37 deletions src/apps/fee-list/fee-list.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe("Fee list", () => {
patron: {
blockStatus: null
}
});
}).as("patronInfo");
});

cy.intercept("GET", "**/external/agencyid/patron/patronid/fees/v2**", {
Expand Down Expand Up @@ -121,19 +121,13 @@ describe("Fee list", () => {
.should("have.text", "Fees & Replacement costs");

// 2.b text "Overdue fees and replacement costs that were created before dd/mm/åååå can still be paid on this page. See our fees and replacement costs"
cy.get(".fee-list-page")
.find("[data-cy='fee-list-body']")
.should("exist")
.should(
"have.text",
"Overdue fees and replacement costs that were created before 27/10/2020 can still be paid on this page. See our fees and replacement costs"
);
cy.getBySel("fee-list-body").should(
"have.text",
"Overdue fees and replacement costs that were created before 27/10/2020 can still be paid on this page. See our fees and replacement costs"
);

// 2.c // 2.e subheadline "Unsettled debt - BEFORE 27/10 2020"
cy.get(".dpl-list-buttons__header")
.first()
.should("exist")
.should("contain.text", "Unsettled debt");
// 2.c // 2.e subheadline "Unsettled debt 1"
cy.getBySel("list-header").should("contain.text", "Unsettled debt");

// 2.d link “See our fees and replacement costs”
cy.get(".fee-list-page")
Expand All @@ -143,15 +137,6 @@ describe("Fee list", () => {
.should("not.have.attr", "href", "")
.should("have.text", "See our fees and replacement costs");

// 3.a text "Please note that paid fees are not registered up until 72 hours after your payment after which your debt is updated and your user unblocked if it has been blocked."
cy.get(".fee-list-bottom__paymenttypes")
.eq(1)
.find("span")
.should("exist")
.should(
"have.text",
"Please note that paid fees are not registered up until 72 hours after your payment after which your debt is updated and your user unblocked if it has been blocked."
);
// 3.b list of intermediates
cy.get(".fee-list-page").find(".list-reservation").eq(0).should("exist");

Expand Down Expand Up @@ -227,21 +212,6 @@ describe("Fee list", () => {
.should("exist")
.should("have.text", "Fee 2.56,-");

// 3. f List of accepted payment cards
cy.get(".fee-list-page")
.find(".fee-list-bottom")
.eq(0)
.find(".fee-list-bottom__paymenttypes")
.find("img")
.should("exist");

// 3. f Button pay
cy.get(".fee-list-bottom__actions")
.eq(0)
.find("button")
.should("exist")
.should("have.text", "Pay");

// 4. a List after date
// Title
cy.get("[data-cy='fee-list-after']")
Expand Down
16 changes: 7 additions & 9 deletions src/apps/fee-list/list.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { FC, ReactNode } from "react";
import ListHeader from "../../components/list-header/list-header";
import { FeeV2 } from "../../core/fbs/model";
import TotalPaymentPay from "./stackable-fees/total-payment-pay";
import StackableFees from "./stackable-fees/stackable-fees";
import { FaustId } from "../../core/utils/types/ids";

Expand All @@ -10,16 +9,14 @@ interface ListProps {
fees: FeeV2[] | null;
dataCy: string;
listHeader: ReactNode;
hideCheckbox: boolean;
totalText: string;
}
const List: FC<ListProps> = ({
openDetailsModalClickEvent,
fees,
listHeader,
dataCy,
totalText,
hideCheckbox
totalText
}) => {
return (
<div>
Expand All @@ -36,11 +33,12 @@ const List: FC<ListProps> = ({
openDetailsModalClickEvent={openDetailsModalClickEvent}
/>
))}
<TotalPaymentPay
hideCheckbox={hideCheckbox}
prePaymentTypeChange={!hideCheckbox}
totalText={totalText}
/>
<div className="fee-list-bottom">
<div className="fee-list-bottom__paymenttypes" />
<div className="fee-list-bottom__actions">
<p className="text-body-small-medium">{totalText}</p>
</div>
</div>
</div>
)}
</div>
Expand Down
96 changes: 0 additions & 96 deletions src/apps/fee-list/stackable-fees/total-payment-pay.tsx

This file was deleted.

10 changes: 8 additions & 2 deletions src/components/list-header/list-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@ export interface ListHeaderProps {
header: string | ReactNode;
amount: number | null;
children?: ReactNode;
dataCy?: string;
}

const ListHeader: FC<ListHeaderProps> = ({ header, amount, children }) => {
const ListHeader: FC<ListHeaderProps> = ({
header,
amount,
children,
dataCy = "list-header"
}) => {
return (
<div className="dpl-list-buttons">
<h2 className="dpl-list-buttons__header">
<h2 data-cy={dataCy} className="dpl-list-buttons__header">
{header}
{amount !== null && (
<div className="dpl-list-buttons__power">{amount}</div>
Expand Down

0 comments on commit fc44b61

Please sign in to comment.