Skip to content

Commit 927978e

Browse files
committed
test(stack): add flex direction test cases to HStack, VStack
1 parent 864c10d commit 927978e

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/* External dependencies */
2+
import React from 'react'
3+
4+
/* Internal dependencies */
5+
import { render } from 'Utils/testUtils'
6+
import HStack from './HStack'
7+
8+
describe('HStack', () => {
9+
it('creates a horizontal flexbox', () => {
10+
const { getByTestId } = render(<HStack testId="h-stack" />)
11+
12+
expect(getByTestId('h-stack')).toHaveStyle('display: flex')
13+
expect(getByTestId('h-stack')).toHaveStyle('flex-direction: row')
14+
})
15+
})
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/* External dependencies */
2+
import React from 'react'
3+
4+
/* Internal dependencies */
5+
import { render } from 'Utils/testUtils'
6+
import VStack from './VStack'
7+
8+
describe('VStack', () => {
9+
it('creates a vertical flexbox', () => {
10+
const { getByTestId } = render(<VStack testId="v-stack" />)
11+
12+
expect(getByTestId('v-stack')).toHaveStyle('display: flex')
13+
expect(getByTestId('v-stack')).toHaveStyle('flex-direction: column')
14+
})
15+
})

0 commit comments

Comments
 (0)