-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add react-query and graphql-request to get info from subgraph * docs(useoffers.ts): add TODO * feat(useoffers.ts): change graphql query to retrieve one offer * feat: add offer pages and navigation * feat: add explore page to navigation * fix: fix colors<->colours variables * feat: add core-components packages * style(header.tsx): fix space left on the sides of the Header * style: fix cursor when hovering disabled inputs and when hovering enabled selects * style: minor style tweeks * refactor: sort imports * feat: update offer price with the new schema * feat: create account image based on address * build(package.json): add @bosonprotocol as npm dependencies * fix(createoffer.tsx): add types to form * ci(.github): deploy to staging when creating new release * feat: manage-offer widget * refactor(package.json): add new version of @bosonprotocol/widgets-sdk without react-use * fix(landing.spec.ts): remove .only * fix: add npm token to gh actions * fix: change name of env * fix: add persist credentials false * fix: change how we insall deps in ci * fix: add npm registry * feat: change BrowserRouter to HashRouter * feat: create REACT_APP_WIDGETS_URL env variable * test(createoffer.test.tsx): add test to test error while calling IpfsMetadata.storeMetadata Co-authored-by: reecejohnson <[email protected]>
- Loading branch information
1 parent
9aee700
commit 1b7fcbe
Showing
5 changed files
with
77 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
REACT_APP_SUBGRAPH_OFFERS_GRAPHQL_ENDPOINT=https://api.thegraph.com/subgraphs/name/dohaki/bosonccropsten | ||
REACT_APP_SUBGRAPH_OFFERS_GRAPHQL_ENDPOINT=https://api.thegraph.com/subgraphs/name/dohaki/bosonccropsten | ||
REACT_APP_WIDGETS_URL=https://boson-widgets-test.surge.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
export const colors = { | ||
navy: "#222539", | ||
red: "red", | ||
green: "#0ffbad", | ||
cgBlue: "#247BA0", | ||
grey: "grey", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { act, render, screen } from "@testing-library/react"; | ||
import { MemoryRouter } from "react-router-dom"; | ||
|
||
import CreateOffer from "./CreateOffer"; | ||
|
||
const storeMetadataErrorMsg = "storeMetadataErrorMsg"; | ||
jest.mock("@bosonprotocol/ipfs-storage", () => { | ||
class IpfsMetadataMock { | ||
storeMetadata() { | ||
return; | ||
} | ||
} | ||
IpfsMetadataMock.prototype.storeMetadata = () => | ||
Promise.reject({ | ||
message: storeMetadataErrorMsg | ||
}); | ||
return { | ||
IpfsMetadata: IpfsMetadataMock | ||
}; | ||
}); | ||
test("renders CreateOffer and expects an error to be displayed if IpfsMetadata.storeMetadata fails", async () => { | ||
render( | ||
<MemoryRouter> | ||
<CreateOffer /> | ||
</MemoryRouter> | ||
); | ||
act(() => { | ||
screen.getByText("Submit").click(); | ||
}); | ||
const error = await screen.findByText(storeMetadataErrorMsg); | ||
expect(error).toBeInTheDocument(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters