Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wallet sync integration test #6899

Merged
merged 2 commits into from
May 21, 2024
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
6 changes: 6 additions & 0 deletions .changeset/old-carrots-complain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"ledger-live-desktop": minor
"@ledgerhq/react-ui": minor
---

Fix border-radius in our react DS for the Button
1 change: 1 addition & 0 deletions apps/ledger-live-desktop/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ module.exports = {
moduleNameMapper: {
...defaultConfig.moduleNameMapper,
"~/(.*)": "<rootDir>/src/$1",
"styled-components": require.resolve("styled-components"),
"\\.(jpg|ico|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$":
"<rootDir>/fileMock.js",
electron: "<rootDir>/tests/mocks/electron.ts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import { useTrack } from "~/renderer/analytics/segment";
import styled from "styled-components";

export const Base = styled(BaseButton)<{ big?: boolean }>`
border-radius: 44px;

font-size: ${p => (p.big ? "14px" : "12px")};
height: 40px;
line-height: 40px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ const SearchContainer = styled(Flex).attrs({ flexShrink: "1" })`
`;

export const Button = styled(BaseButton)<{ big?: boolean }>`
border-radius: 44px;

${p =>
p.Icon
? `
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* @jest-environment jsdom
*/

import { describe, it, expect } from "@jest/globals";

import React from "react";
import { render, screen, waitFor } from "tests/testUtils";
import "@testing-library/jest-dom";
import { WalletSyncPages } from "../setupTests/shared";

describe("Rendering", () => {
it("should loads and displays WalletSync Row", async () => {
render(<WalletSyncPages />);
expect(screen.getByRole("button", { name: "Manage" })).toBeTruthy();
});

it("should open drawer and display Wallet Sync Activation flow", async () => {
const { user } = render(<WalletSyncPages />);
const button = screen.getByRole("button", { name: "Manage" });

await user.click(button);
await waitFor(() =>
expect(screen.getByRole("button", { name: "Create a backup" })).toBeDefined(),
);

expect(screen.getByRole("button", { name: "Synchronize" })).toBeDefined();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export const Base = baseStyled.button.attrs((p: BaseProps) => ({
}))<BaseProps>`
background-color: transparent;
border-color: transparent;
border-radius: ${p => p.theme.space[13]}px;
border-radius: 44px;
border-style: solid;
border-width: ${p => (p.outline || p.variant === "shade" ? 1 : 0)}px;
font-weight: 600;
Expand Down
Loading