Skip to content

Commit

Permalink
test: add test for activeWallet inside ActionSelectionForm
Browse files Browse the repository at this point in the history
  • Loading branch information
MinHtet-O committed Jul 1, 2024
1 parent 338deb7 commit c565a40
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ const defaultProps = {

describe("ActionSelectionForm", () => {
it("should display the non-editable beneficiary & holder", async () => {
await act(async () => {
const container = render(<ActionSelectionForm {...defaultProps} />);
const activeWalletComponent = container.getByTestId("activeWallet");
const holderText = within(activeWalletComponent).getByText("0xa61B056dA0084a5f391EC137583073096880C2e3");
expect(activeWalletComponent).not.toBeNull();
expect(holderText).not.toBeNull();
});
});

it("should display the active wallet", async () => {
await act(async () => {
const container = render(<ActionSelectionForm {...defaultProps} />);
const beneficiaryComponent = container.getByTestId("asset-title-owner");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ export const ActionSelectionForm: FunctionComponent<ActionSelectionFormProps> =
{account ? (
<div
onClick={handleWalletInfoClick}
data-testid="activeWallet"
className="w-44 p-4 ml-auto flex items-center bg-gray-100 text-gray-800 rounded-lg shadow cursor-pointer hover:bg-gray-200 transition duration-300 ease-in-out select-none"
>
<img src={"/static/images/wallet.png"} alt="Wallet Icon" className="w-6 h-6 mr-4" />
Expand Down

0 comments on commit c565a40

Please sign in to comment.