Skip to content

Commit

Permalink
feat: change Seller info in offer details page & change description p…
Browse files Browse the repository at this point in the history
…laceholder in create offer page (#27)

* feat: change Seller info in offer details page & change description placeholder in create offer page

* test: fix failing test
  • Loading branch information
albertfolch-redeemeum authored May 11, 2022
1 parent d07e760 commit f5a89e1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
7 changes: 1 addition & 6 deletions e2e-tests/OfferDetail.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,7 @@ test.describe("OfferDetail", () => {

const sellerId = await page.locator("[data-testid=seller-id]");
const expectedSellerId =
"Seller ID: " + expectedOffer.seller?.id || "Unexpected id";
"ID: " + expectedOffer.seller?.id || "Unexpected id";
await expect(sellerId).toHaveText(expectedSellerId);

const sellerDescription = await page.locator(
"[data-testid=seller-description]"
);
await expect(sellerDescription).toHaveText("Not defined");
});
});
3 changes: 2 additions & 1 deletion src/pages/create-offer/CreateOffer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ export default function CreateOffer() {
const { values, handleChange, handleSubmit } = useFormik({
initialValues: {
name: "Baggy jeans",
description: "Lore ipsum",
description:
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent in facilisis purus, nec egestas eros. Aliquam dignissim tellus sit amet sem auctor, non commodo eros eleifend. Sed in tellus porttitor, placerat leo et, faucibus tortor. Nunc efficitur nibh id libero blandit, vel ornare erat vehicula.",
externalUrl: window.location.origin,
schemaUrl: "https://schema.org/schema",
price: "1",
Expand Down
18 changes: 9 additions & 9 deletions src/pages/offers/OfferDetail.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { manageOffer } from "@bosonprotocol/widgets-sdk";
import AddressImage from "@components/offer/AddressImage";
import RootPrice from "@components/price";
import { CONFIG } from "@lib/config";
import { QueryParameters, UrlParameters } from "@lib/routing/query-parameters";
Expand Down Expand Up @@ -168,6 +169,7 @@ export default function OfferDetail() {
const name = offer.metadata?.name || "Untitled";
const offerImg = `https://picsum.photos/seed/${offerId}/700`;
const sellerId = offer.seller?.id;
const sellerAddress = offer.seller?.admin;
const description = offer.metadata?.description || "";

return (
Expand All @@ -186,22 +188,20 @@ export default function OfferDetail() {
<SubHeading>Description</SubHeading>
<Information data-testid="description">{description}</Information>
</Box>
<Box>
<SubHeading>Seller Description</SubHeading>
<span data-testid="seller-description">Not defined</span>
</Box>

<Box>
<SubHeading>Delivery Information</SubHeading>
<span data-testid="delivery-info">Not defined</span>
</Box>
<Box>
<SubHeading> Seller</SubHeading>
<AddressContainer>
<AddressImage address={sellerAddress} />
<div data-testid="seller-id">ID: {sellerId}</div>
</AddressContainer>
</Box>
</Info>
</ImageAndDescription>
<Content>
<AddressContainer data-testid="seller-id">
Seller ID: {sellerId}
</AddressContainer>

<Title data-testid="name">{name}</Title>

<Box>
Expand Down

0 comments on commit f5a89e1

Please sign in to comment.