Skip to content

Commit cee6763

Browse files
authored
test(accordion): add unit tests (#2079)
1 parent 107b77d commit cee6763

File tree

7 files changed

+239
-219
lines changed

7 files changed

+239
-219
lines changed

tests/Accordion.test.svelte

Lines changed: 0 additions & 219 deletions
This file was deleted.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<script lang="ts">
2+
import { Accordion, AccordionItem } from "carbon-components-svelte";
3+
</script>
4+
5+
<Accordion disabled>
6+
<AccordionItem title="Natural Language Classifier">
7+
<p>
8+
Natural Language Classifier uses advanced natural language processing and
9+
machine learning techniques to create custom classification models. Users
10+
train their data and the service predicts the appropriate category for the
11+
inputted text.
12+
</p>
13+
</AccordionItem>
14+
<AccordionItem title="Natural Language Understanding">
15+
<p>
16+
Analyze text to extract meta-data from content such as concepts, entities,
17+
emotion, relations, sentiment and more.
18+
</p>
19+
</AccordionItem>
20+
<AccordionItem title="Language Translator">
21+
<p>
22+
Translate text, documents, and websites from one language to another.
23+
Create industry or region-specific translations via the service's
24+
customization capability.
25+
</p>
26+
</AccordionItem>
27+
</Accordion>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<script lang="ts">
2+
import { Accordion, AccordionItem, Button } from "carbon-components-svelte";
3+
4+
const items = [
5+
{
6+
title: "Natural Language Classifier",
7+
description:
8+
"Natural Language Classifier uses advanced natural language processing and machine learning techniques to create custom classification models. Users train their data and the service predicts the appropriate category for the inputted text.",
9+
},
10+
{
11+
title: "Natural Language Understanding",
12+
description:
13+
"Analyze text to extract meta-data from content such as concepts, entities, emotion, relations, sentiment and more.",
14+
},
15+
{
16+
title: "Language Translator",
17+
description:
18+
"Translate text, documents, and websites from one language to another. Create industry or region-specific translations via the service's customization capability.",
19+
},
20+
];
21+
22+
let open = false;
23+
</script>
24+
25+
<Button kind="ghost" size="field" on:click={() => (open = !open)}>
26+
{open ? "Collapse" : "Expand"}
27+
all
28+
</Button>
29+
30+
<Accordion>
31+
{#each items as item}
32+
<AccordionItem title={item.title} {open}>
33+
<p>{item.description}</p>
34+
</AccordionItem>
35+
{/each}
36+
</Accordion>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<script lang="ts">
2+
import { Accordion } from "carbon-components-svelte";
3+
</script>
4+
5+
<Accordion skeleton />
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<script lang="ts">
2+
import { Accordion, AccordionItem } from "carbon-components-svelte";
3+
</script>
4+
5+
<Accordion>
6+
<AccordionItem title="Natural Language Classifier">
7+
<p>
8+
Natural Language Classifier uses advanced natural language processing and
9+
machine learning techniques to create custom classification models. Users
10+
train their data and the service predicts the appropriate category for the
11+
inputted text.
12+
</p>
13+
</AccordionItem>
14+
<AccordionItem title="Natural Language Understanding" disabled>
15+
<p>
16+
Analyze text to extract meta-data from content such as concepts, entities,
17+
emotion, relations, sentiment and more.
18+
</p>
19+
</AccordionItem>
20+
<AccordionItem title="Language Translator">
21+
<p>
22+
Translate text, documents, and websites from one language to another.
23+
Create industry or region-specific translations via the service's
24+
customization capability.
25+
</p>
26+
</AccordionItem>
27+
</Accordion>

0 commit comments

Comments
 (0)