• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

cartesi / rollups-explorer / 10317825307

09 Aug 2024 10:34AM CUT coverage: 93.674% (-0.05%) from 93.722%
10317825307

Pull #223

github

nevendyulgerov
chore(packages/ui): Revert change
Pull Request #223: #220 Upgrade mantine packages

1147 of 1362 branches covered (84.21%)

Branch coverage included in aggregate %.

18 of 18 new or added lines in 4 files covered. (100.0%)

9 existing lines in 1 file now uncovered.

12403 of 13103 relevant lines covered (94.66%)

39.54 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

85.48
/apps/web/src/components/specification/components/DecodingPreview.tsx
1
"use client";
1✔
2
import { CodeHighlight } from "@mantine/code-highlight";
1✔
3
import { Alert, Card, Stack, Text, Textarea, Title } from "@mantine/core";
1✔
4
import { decodePayload } from "../decoder";
1✔
5
import { useSpecFormContext } from "../form/context";
1✔
6
import { buildSpecification, stringifyContent } from "../utils";
1✔
7

1✔
8
export const DecodingPreview = () => {
1✔
9
    const form = useSpecFormContext();
108✔
10
    const values = form.getTransformedValues();
108✔
11
    const { encodedData } = values;
108✔
12
    const tempSpec = buildSpecification(values);
108✔
13
    const envelope =
108✔
14
        tempSpec && encodedData ? decodePayload(tempSpec, encodedData) : null;
108✔
15
    const content = envelope?.result ? stringifyContent(envelope.result) : null;
108✔
16

108✔
17
    return (
108✔
18
        <Card shadow="sm" withBorder>
108✔
19
            <Title order={3}>Preview</Title>
108✔
20
            <Stack gap="lg">
108✔
21
                <Textarea
108✔
22
                    resize="vertical"
108✔
23
                    rows={5}
108✔
24
                    label="Data"
108✔
25
                    id="encoded-data-preview"
108✔
26
                    description="Encoded data to test against specification"
108✔
27
                    {...form.getInputProps("encodedData")}
108✔
28
                />
108✔
29

108✔
30
                {content && (
108✔
31
                    <CodeHighlight
1✔
32
                        data-testid="preview-decoded-data"
1✔
33
                        withCopyButton={false}
1✔
34
                        language="json"
1✔
35
                        code={content}
1✔
36
                    />
1✔
37
                )}
108✔
38

108✔
39
                {envelope?.error && (
108!
40
                    <Alert
×
41
                        color="yellow"
×
42
                        title="Keep changing your specification"
×
43
                    >
×
44
                        <Text style={{ whiteSpace: "pre-line" }}>
×
45
                            {envelope.error.message}
×
46
                        </Text>
×
47
                    </Alert>
×
48
                )}
108✔
49
            </Stack>
108✔
50
        </Card>
108✔
51
    );
108✔
52
};
108✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc