Skip to content

Commit

Permalink
adding some test-ids
Browse files Browse the repository at this point in the history
Mohammed-Mamoun98 committed Dec 2, 2024
1 parent b83319d commit 76c4c10
Showing 3 changed files with 18 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -6,17 +6,20 @@ import { DataLoading } from "@/components/data-loading";
import { NoData } from "@/components/no-data";
import { useIdOS } from "@/core/idos";

const useFetchFilteredCredentials = () => {
const useFetchFilteredCredentials = (country: string) => {
const { sdk } = useIdOS();

return useQuery({
queryKey: ["e2e-credential-filtering-by-country"],
queryFn: () => sdk.data.listCredentialsFilteredByCountries(["DE"]),
queryFn: () => sdk.data.listCredentialsFilteredByCountries([country]),
});
};

export function Component() {
const credentialIds = useFetchFilteredCredentials();
const searchParams = new URLSearchParams(document.location.search);
const country = searchParams.get("country") || "DE";

const credentialIds = useFetchFilteredCredentials(country);

return (
<VStack align="stretch" flex={1} gap={2.5}>
@@ -37,7 +40,7 @@ export function Component() {
lg: "xx-large",
}}
>
Credentials filtered by country (DE)
Credentials filtered by country {country}
</Heading>
</HStack>

2 changes: 1 addition & 1 deletion apps/idos-data-dashboard/src/routes/dashboard/index.tsx
Original file line number Diff line number Diff line change
@@ -176,7 +176,7 @@ export function Component() {
</ListItemLink>
</ListItem>
<ListItem>
<ListItemLink to="/wallets">
<ListItemLink to="/wallets" data-testid="wallets-link">
<Wallet2Icon size={24} strokeWidth="1.5" />
<Text as="span">Wallets</Text>
</ListItemLink>
Original file line number Diff line number Diff line change
@@ -9,12 +9,20 @@ type WalletCardProps = {

export const WalletCard = ({ address, isDisabled, onDelete }: WalletCardProps) => {
return (
<HStack align="center" justify="space-between" gap={5} p={5} bg="neutral.900" rounded="xl">
<HStack
align="center"
justify="space-between"
gap={5}
p={5}
bg="neutral.900"
rounded="xl"
data-testid="wallet-card"
>
<HStack gap={5}>
<Image src="/idos-dashboard-logo-dark.svg" alt="Wallet image" w={50} h={50} />
<VStack align="stretch" gap={0} overflow="hidden">
<Text color="neutral.600">Address</Text>
<Text isTruncated maxW={200}>
<Text isTruncated maxW={200} data-testid="wallet-address">
{address}
</Text>
</VStack>

0 comments on commit 76c4c10

Please sign in to comment.