generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathsystem-tag.test.ts
More file actions
49 lines (46 loc) · 1.15 KB
/
system-tag.test.ts
File metadata and controls
49 lines (46 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
import { ComponentDefinition } from '../../src/components/interfaces';
import { buildProject } from './test-helpers';
let component: ComponentDefinition;
beforeAll(() => {
const result = buildProject('system-tag');
expect(result).toHaveLength(1);
component = result[0];
});
test('should have correct region definitions', () => {
expect(component.properties).toEqual([
{
name: 'color',
description: 'Color',
type: 'string',
optional: true,
systemTags: ['core'],
},
{
name: 'fontFamily',
description: 'Font family\nMore text',
type: 'string',
optional: true,
systemTags: ['core', 'something'],
},
{
name: 'variant',
description: 'Variant',
type: 'string',
optional: true,
inlineType: {
name: 'ExampleProps.Variant',
type: 'union',
values: ['primary', 'secondary'],
},
},
]);
expect(component.regions).toEqual([
{
name: 'children',
description: 'Main content',
isDefault: true,
},
]);
});