Skip to content

Commit

Permalink
✨feat(llm): add integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasWerey committed Aug 7, 2024
1 parent 940533c commit d0735fe
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const FallbackCameraBody: React.FC<Props> = ({
const { colors } = useTheme();

return (
<Flex flex={1} bg={hasNoBackground ? null : "background.main"} px={6}>
<Flex flex={1} bg={hasNoBackground ? "transparent" : "background.main"} px={6}>
<Flex flex={1} alignItems="center" justifyContent="center">
<FallbackCamera color={colors.constant.white} />
<Text variant="paragraph" mt={9} mb={3} fontSize={6}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const StepFlow = ({

// That means the url as be stored in the store
const onQrCodeScanned = (data: string) => {
// eslint-disable-next-line no-console
console.log(data);
// setCurrentStep(Steps.PinCodeInput);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ describe("WalletSyncSettings", () => {
await user.press(await screen.findByText(/ledger sync/i));
await user.press(await screen.findByText(/already created a key?/i));
await user.press(await screen.findByText(/scan a qr code/i));
await expect(await screen.findByText(/show qr/i)).toBeVisible();
await expect(screen.queryAllByText(/scan qr code/i)).toHaveLength(2);
await expect(screen.getByTestId("scan-ws-camera")).toBeVisible();
});

it("Should display the QR code when 'show qr' toggle is pressed", async () => {
Expand All @@ -62,7 +63,7 @@ describe("WalletSyncSettings", () => {
await user.press(await screen.findByText(/ledger sync/i));
await user.press(await screen.findByText(/already created a key?/i));
await user.press(await screen.findByText(/scan a qr code/i));
await user.press(await screen.findByText(/show qr/i));
await user.press(await screen.queryAllByText(/show qr/i)[0]);
await expect(await screen.getByTestId("ws-show-qr-code")).toBeVisible();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const BottomContainer = ({ steps }: Props) => {
<ScrollContainer
px={16}
py={24}
maxHeight={220}
background={colors.opacityDefault.c05}
borderRadius={24}
showsVerticalScrollIndicator={false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,13 @@ const ScanQrCode = ({ onQrCodeScanned }: Props) => {
];

return (
<Flex minHeight={400} justifyContent={"center"} alignItems={"center"} rowGap={24}>
<Flex
minHeight={400}
justifyContent={"center"}
alignItems={"center"}
rowGap={24}
testID={"scan-ws-camera"}
>
<RequiresCameraPermissions optimisticallyMountChildren fallBackHasNoBackground>
<Flex>
<Camera
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const useActivationDrawerModel = ({ isOpen, startingStep, handleClose }: Props)

// That means the url as be stored in the store
const onQrCodeScanned = (data: string) => {
// eslint-disable-next-line no-console
console.log(data);
//setCurrentStep(Steps.PinCodeInput);
};
Expand Down

0 comments on commit d0735fe

Please sign in to comment.