1
- import { render } from '@bolt/twig-renderer ' ;
1
+ import { render , stopServer , html } from '../../../testing/testing-helpers ' ;
2
2
3
3
const { readYamlFileSync } = require ( '@bolt/build-tools/utils/yaml' ) ;
4
4
const { join } = require ( 'path' ) ;
5
5
const schema = readYamlFileSync ( join ( __dirname , '../headline.schema.yml' ) ) ;
6
6
const { tag, size, align, transform } = schema . properties ;
7
7
8
8
describe ( '<bolt-headline> Component' , ( ) => {
9
+ afterAll ( async ( ) => {
10
+ await stopServer ( ) ;
11
+ } , 100 ) ;
12
+
9
13
test ( 'basic usage headline' , async ( ) => {
10
14
const results = await render ( '@bolt-components-headline/headline.twig' , {
11
15
text : 'this is a headline' ,
@@ -21,6 +25,7 @@ describe('<bolt-headline> Component', () => {
21
25
expect ( results . ok ) . toBe ( true ) ;
22
26
expect ( results . html ) . toMatchSnapshot ( ) ;
23
27
} ) ;
28
+
24
29
test ( 'basic usage eyebrow' , async ( ) => {
25
30
const results = await render ( '@bolt-components-headline/eyebrow.twig' , {
26
31
text : 'this is an eyebrow' ,
@@ -54,7 +59,7 @@ describe('<bolt-headline> Component', () => {
54
59
expect ( results . html ) . toMatchSnapshot ( ) ;
55
60
} ) ;
56
61
57
- tag . enum . forEach ( async displayChoice => {
62
+ tag . enum . forEach ( displayChoice => {
58
63
test ( `tag display: ${ displayChoice } ` , async ( ) => {
59
64
const results = await render ( '@bolt-components-headline/headline.twig' , {
60
65
tag : displayChoice ,
@@ -65,7 +70,7 @@ describe('<bolt-headline> Component', () => {
65
70
} ) ;
66
71
} ) ;
67
72
68
- align . enum . forEach ( async alignmentChoice => {
73
+ align . enum . forEach ( alignmentChoice => {
69
74
test ( `text alignment: ${ alignmentChoice } ` , async ( ) => {
70
75
const results = await render ( '@bolt-components-headline/headline.twig' , {
71
76
align : alignmentChoice ,
@@ -76,10 +81,10 @@ describe('<bolt-headline> Component', () => {
76
81
} ) ;
77
82
} ) ;
78
83
79
- size . enum . forEach ( async sizeChoice => {
84
+ size . enum . forEach ( sizeChoice => {
80
85
const fontWeight = [ 'bold' , 'regular' , 'semibold' ] ;
81
86
82
- fontWeight . forEach ( async weightChoice => {
87
+ fontWeight . forEach ( weightChoice => {
83
88
test ( `Sizes at all varient font weights: ${ sizeChoice } , ${ weightChoice } ` , async ( ) => {
84
89
const results = await render (
85
90
'@bolt-components-headline/headline.twig' ,
@@ -95,10 +100,10 @@ describe('<bolt-headline> Component', () => {
95
100
} ) ;
96
101
} ) ;
97
102
98
- size . enum . forEach ( async sizeChoice => {
103
+ size . enum . forEach ( sizeChoice => {
99
104
const fontStyle = [ 'normal' , 'italic' ] ;
100
105
101
- fontStyle . forEach ( async fontChoice => {
106
+ fontStyle . forEach ( fontChoice => {
102
107
test ( `Sizes at all varient font styles: ${ sizeChoice } , ${ fontChoice } ` , async ( ) => {
103
108
const results = await render (
104
109
'@bolt-components-headline/headline.twig' ,
@@ -114,7 +119,7 @@ describe('<bolt-headline> Component', () => {
114
119
} ) ;
115
120
} ) ;
116
121
117
- transform . enum . forEach ( async caseChoice => {
122
+ transform . enum . forEach ( caseChoice => {
118
123
test ( `text casing: ${ caseChoice } ` , async ( ) => {
119
124
const results = await render ( '@bolt-components-headline/headline.twig' , {
120
125
transform : caseChoice ,
0 commit comments