@pyreon/coolgrid 0.11.5 → 0.11.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
- import type { VNode } from "@pyreon/core"
2
- import { beforeEach, describe, expect, it, vi } from "vitest"
1
+ import type { VNode } from '@pyreon/core'
2
+ import { beforeEach, describe, expect, it, vi } from 'vitest'
3
3
 
4
4
  const mockProvide = vi.fn()
5
5
  const mockUseContext = vi.fn()
6
6
 
7
- vi.mock("@pyreon/core", async (importOriginal) => {
8
- const original = await importOriginal<typeof import("@pyreon/core")>()
7
+ vi.mock('@pyreon/core', async (importOriginal) => {
8
+ const original = await importOriginal<typeof import('@pyreon/core')>()
9
9
  return {
10
10
  ...original,
11
11
  provide: (...args: any[]) => {
@@ -21,8 +21,8 @@ vi.mock("@pyreon/core", async (importOriginal) => {
21
21
  })
22
22
 
23
23
  // Mock unistyle context to return empty theme
24
- vi.mock("@pyreon/unistyle", async (importOriginal) => {
25
- const original = await importOriginal<typeof import("@pyreon/unistyle")>()
24
+ vi.mock('@pyreon/unistyle', async (importOriginal) => {
25
+ const original = await importOriginal<typeof import('@pyreon/unistyle')>()
26
26
  return {
27
27
  ...original,
28
28
  }
@@ -30,102 +30,102 @@ vi.mock("@pyreon/unistyle", async (importOriginal) => {
30
30
 
31
31
  const asVNode = (v: unknown) => v as VNode
32
32
 
33
- describe("Col", () => {
33
+ describe('Col', () => {
34
34
  beforeEach(() => {
35
35
  vi.clearAllMocks()
36
36
  // Default: no context (empty object)
37
37
  mockUseContext.mockReturnValue({})
38
38
  })
39
39
 
40
- it("returns a VNode", async () => {
41
- const Col = (await import("../Col")).default
42
- const result = asVNode(Col({ children: "test" }))
40
+ it('returns a VNode', async () => {
41
+ const Col = (await import('../Col')).default
42
+ const result = asVNode(Col({ children: 'test' }))
43
43
  expect(result).toBeDefined()
44
44
  expect(result.type).toBeDefined()
45
45
  })
46
46
 
47
- it("has correct displayName", async () => {
48
- const Col = (await import("../Col")).default
49
- expect(Col.displayName).toBe("@pyreon/coolgrid/Col")
47
+ it('has correct displayName', async () => {
48
+ const Col = (await import('../Col')).default
49
+ expect(Col.displayName).toBe('@pyreon/coolgrid/Col')
50
50
  })
51
51
 
52
- it("has correct pkgName", async () => {
53
- const Col = (await import("../Col")).default
54
- expect(Col.pkgName).toBe("@pyreon/coolgrid")
52
+ it('has correct pkgName', async () => {
53
+ const Col = (await import('../Col')).default
54
+ expect(Col.pkgName).toBe('@pyreon/coolgrid')
55
55
  })
56
56
 
57
- it("has PYREON__COMPONENT static", async () => {
58
- const Col = (await import("../Col")).default
59
- expect(Col.PYREON__COMPONENT).toBe("@pyreon/coolgrid/Col")
57
+ it('has PYREON__COMPONENT static', async () => {
58
+ const Col = (await import('../Col')).default
59
+ expect(Col.PYREON__COMPONENT).toBe('@pyreon/coolgrid/Col')
60
60
  })
61
61
 
62
- it("passes $coolgrid prop with grid values", async () => {
63
- const Col = (await import("../Col")).default
64
- const result = asVNode(Col({ size: 6, children: "test" }))
65
- expect(result.props).toHaveProperty("$coolgrid")
62
+ it('passes $coolgrid prop with grid values', async () => {
63
+ const Col = (await import('../Col')).default
64
+ const result = asVNode(Col({ size: 6, children: 'test' }))
65
+ expect(result.props).toHaveProperty('$coolgrid')
66
66
  })
67
67
 
68
- it("does not provide context (Col only reads, never provides)", async () => {
69
- const Col = (await import("../Col")).default
70
- Col({ children: "test" })
68
+ it('does not provide context (Col only reads, never provides)', async () => {
69
+ const Col = (await import('../Col')).default
70
+ Col({ children: 'test' })
71
71
  expect(mockProvide).not.toHaveBeenCalled()
72
72
  })
73
73
 
74
- it("strips context keys from DOM props", async () => {
75
- const Col = (await import("../Col")).default
74
+ it('strips context keys from DOM props', async () => {
75
+ const Col = (await import('../Col')).default
76
76
  const result = asVNode(
77
77
  Col({
78
78
  columns: 12,
79
79
  gap: 16,
80
80
  size: 6,
81
- "data-testid": "my-col",
82
- children: "test",
81
+ 'data-testid': 'my-col',
82
+ children: 'test',
83
83
  }),
84
84
  )
85
85
  // context keys should be stripped from the rendered props
86
86
  // but $coolgrid should be present
87
87
  expect(result.props.$coolgrid).toBeDefined()
88
- expect(result.props["data-testid"]).toBe("my-col")
88
+ expect(result.props['data-testid']).toBe('my-col')
89
89
  })
90
90
 
91
- it("passes css as extraStyles when provided", async () => {
92
- const Col = (await import("../Col")).default
93
- const customCss = "background: green;"
94
- const result = asVNode(Col({ css: customCss, children: "test" }))
91
+ it('passes css as extraStyles when provided', async () => {
92
+ const Col = (await import('../Col')).default
93
+ const customCss = 'background: green;'
94
+ const result = asVNode(Col({ css: customCss, children: 'test' }))
95
95
  expect((result.props.$coolgrid as Record<string, unknown>).extraStyles).toBe(customCss)
96
96
  })
97
97
 
98
- it("includes columns and gap in $coolgrid", async () => {
99
- const Col = (await import("../Col")).default
100
- const result = asVNode(Col({ columns: 12, gap: 16, size: 6, children: "test" }))
98
+ it('includes columns and gap in $coolgrid', async () => {
99
+ const Col = (await import('../Col')).default
100
+ const result = asVNode(Col({ columns: 12, gap: 16, size: 6, children: 'test' }))
101
101
  const coolgrid = result.props.$coolgrid as Record<string, unknown>
102
102
  expect(coolgrid.columns).toBe(12)
103
103
  expect(coolgrid.gap).toBe(16)
104
104
  expect(coolgrid.size).toBe(6)
105
105
  })
106
106
 
107
- it("renders with data-coolgrid attribute in dev mode", async () => {
108
- const Col = (await import("../Col")).default
109
- const result = asVNode(Col({ children: "test" }))
110
- expect(result.props["data-coolgrid"]).toBe("col")
107
+ it('renders with data-coolgrid attribute in dev mode', async () => {
108
+ const Col = (await import('../Col')).default
109
+ const result = asVNode(Col({ children: 'test' }))
110
+ expect(result.props['data-coolgrid']).toBe('col')
111
111
  })
112
112
 
113
113
  it("passes component prop as 'as'", async () => {
114
- const Col = (await import("../Col")).default
114
+ const Col = (await import('../Col')).default
115
115
  const customComponent = (() => null) as any
116
- const result = asVNode(Col({ component: customComponent, children: "test" }))
116
+ const result = asVNode(Col({ component: customComponent, children: 'test' }))
117
117
  expect(result.props.as).toBe(customComponent)
118
118
  })
119
119
 
120
- it("includes padding in $coolgrid", async () => {
121
- const Col = (await import("../Col")).default
122
- const result = asVNode(Col({ padding: 8, children: "test" }))
120
+ it('includes padding in $coolgrid', async () => {
121
+ const Col = (await import('../Col')).default
122
+ const result = asVNode(Col({ padding: 8, children: 'test' }))
123
123
  expect((result.props.$coolgrid as Record<string, unknown>).padding).toBe(8)
124
124
  })
125
125
 
126
- it("renders children in VNode", async () => {
127
- const Col = (await import("../Col")).default
128
- const result = asVNode(Col({ children: "hello" }))
126
+ it('renders children in VNode', async () => {
127
+ const Col = (await import('../Col')).default
128
+ const result = asVNode(Col({ children: 'hello' }))
129
129
  expect(result.children).toBeDefined()
130
130
  })
131
131
  })
@@ -1,49 +1,49 @@
1
- import { describe, expect, it } from "vitest"
2
- import { getContainerWidth } from "../Container/utils"
1
+ import { describe, expect, it } from 'vitest'
2
+ import { getContainerWidth } from '../Container/utils'
3
3
 
4
- describe("Container/utils – getContainerWidth", () => {
5
- it("returns width from props when present", () => {
4
+ describe('Container/utils – getContainerWidth', () => {
5
+ it('returns width from props when present', () => {
6
6
  const result = getContainerWidth({ width: 960 }, {})
7
7
  expect(result).toBe(960)
8
8
  })
9
9
 
10
- it("prefers props.width over theme.grid.container", () => {
10
+ it('prefers props.width over theme.grid.container', () => {
11
11
  const result = getContainerWidth(
12
12
  { width: 800 },
13
- { grid: { container: { xs: "100%", md: 720 } } },
13
+ { grid: { container: { xs: '100%', md: 720 } } },
14
14
  )
15
15
  expect(result).toBe(800)
16
16
  })
17
17
 
18
- it("falls back to theme.grid.container", () => {
19
- const result = getContainerWidth({}, { grid: { container: { xs: "100%", md: 720 } } })
20
- expect(result).toEqual({ xs: "100%", md: 720 })
18
+ it('falls back to theme.grid.container', () => {
19
+ const result = getContainerWidth({}, { grid: { container: { xs: '100%', md: 720 } } })
20
+ expect(result).toEqual({ xs: '100%', md: 720 })
21
21
  })
22
22
 
23
- it("falls back to theme.coolgrid.container when grid is missing", () => {
24
- const result = getContainerWidth({}, { coolgrid: { container: { xs: "100%", lg: 960 } } })
25
- expect(result).toEqual({ xs: "100%", lg: 960 })
23
+ it('falls back to theme.coolgrid.container when grid is missing', () => {
24
+ const result = getContainerWidth({}, { coolgrid: { container: { xs: '100%', lg: 960 } } })
25
+ expect(result).toEqual({ xs: '100%', lg: 960 })
26
26
  })
27
27
 
28
- it("returns undefined/falsy when nothing matches", () => {
28
+ it('returns undefined/falsy when nothing matches', () => {
29
29
  expect(getContainerWidth({}, {})).toBeFalsy()
30
30
  })
31
31
 
32
- it("returns undefined/falsy when both are undefined", () => {
32
+ it('returns undefined/falsy when both are undefined', () => {
33
33
  expect(getContainerWidth(undefined, undefined)).toBeFalsy()
34
34
  })
35
35
 
36
- it("returns undefined/falsy when both are empty objects", () => {
36
+ it('returns undefined/falsy when both are empty objects', () => {
37
37
  expect(getContainerWidth({}, {})).toBeFalsy()
38
38
  })
39
39
 
40
- it("returns string width from props", () => {
41
- const result = getContainerWidth({ width: "100%" }, {})
42
- expect(result).toBe("100%")
40
+ it('returns string width from props', () => {
41
+ const result = getContainerWidth({ width: '100%' }, {})
42
+ expect(result).toBe('100%')
43
43
  })
44
44
 
45
- it("returns responsive object from props", () => {
46
- const result = getContainerWidth({ width: { xs: "100%", md: 720, lg: 960 } }, {})
47
- expect(result).toEqual({ xs: "100%", md: 720, lg: 960 })
45
+ it('returns responsive object from props', () => {
46
+ const result = getContainerWidth({ width: { xs: '100%', md: 720, lg: 960 } }, {})
47
+ expect(result).toEqual({ xs: '100%', md: 720, lg: 960 })
48
48
  })
49
49
  })
@@ -1,11 +1,11 @@
1
- import type { VNode } from "@pyreon/core"
2
- import { beforeEach, describe, expect, it, vi } from "vitest"
1
+ import type { VNode } from '@pyreon/core'
2
+ import { beforeEach, describe, expect, it, vi } from 'vitest'
3
3
 
4
4
  const mockProvide = vi.fn()
5
5
  const mockUseContext = vi.fn()
6
6
 
7
- vi.mock("@pyreon/core", async (importOriginal) => {
8
- const original = await importOriginal<typeof import("@pyreon/core")>()
7
+ vi.mock('@pyreon/core', async (importOriginal) => {
8
+ const original = await importOriginal<typeof import('@pyreon/core')>()
9
9
  return {
10
10
  ...original,
11
11
  provide: (...args: any[]) => {
@@ -22,126 +22,126 @@ vi.mock("@pyreon/core", async (importOriginal) => {
22
22
 
23
23
  const asVNode = (v: unknown) => v as VNode
24
24
 
25
- describe("Container", () => {
25
+ describe('Container', () => {
26
26
  beforeEach(() => {
27
27
  vi.clearAllMocks()
28
28
  // unistyle context returns empty theme
29
29
  mockUseContext.mockReturnValue({ theme: {} })
30
30
  })
31
31
 
32
- it("returns a VNode", async () => {
33
- const Container = (await import("../Container")).default
34
- const result = asVNode(Container({ children: "test" }))
32
+ it('returns a VNode', async () => {
33
+ const Container = (await import('../Container')).default
34
+ const result = asVNode(Container({ children: 'test' }))
35
35
  expect(result).toBeDefined()
36
36
  expect(result.type).toBeDefined()
37
37
  })
38
38
 
39
- it("has correct displayName", async () => {
40
- const Container = (await import("../Container")).default
41
- expect(Container.displayName).toBe("@pyreon/coolgrid/Container")
39
+ it('has correct displayName', async () => {
40
+ const Container = (await import('../Container')).default
41
+ expect(Container.displayName).toBe('@pyreon/coolgrid/Container')
42
42
  })
43
43
 
44
- it("has correct pkgName", async () => {
45
- const Container = (await import("../Container")).default
46
- expect(Container.pkgName).toBe("@pyreon/coolgrid")
44
+ it('has correct pkgName', async () => {
45
+ const Container = (await import('../Container')).default
46
+ expect(Container.pkgName).toBe('@pyreon/coolgrid')
47
47
  })
48
48
 
49
- it("has PYREON__COMPONENT static", async () => {
50
- const Container = (await import("../Container")).default
51
- expect(Container.PYREON__COMPONENT).toBe("@pyreon/coolgrid/Container")
49
+ it('has PYREON__COMPONENT static', async () => {
50
+ const Container = (await import('../Container')).default
51
+ expect(Container.PYREON__COMPONENT).toBe('@pyreon/coolgrid/Container')
52
52
  })
53
53
 
54
- it("passes $coolgrid prop with width and extraStyles", async () => {
55
- const Container = (await import("../Container")).default
56
- const result = asVNode(Container({ children: "test" }))
57
- expect(result.props).toHaveProperty("$coolgrid")
58
- expect(result.props.$coolgrid).toHaveProperty("width")
54
+ it('passes $coolgrid prop with width and extraStyles', async () => {
55
+ const Container = (await import('../Container')).default
56
+ const result = asVNode(Container({ children: 'test' }))
57
+ expect(result.props).toHaveProperty('$coolgrid')
58
+ expect(result.props.$coolgrid).toHaveProperty('width')
59
59
  })
60
60
 
61
- it("provides ContainerContext", async () => {
62
- const Container = (await import("../Container")).default
63
- Container({ columns: 12, gap: 16, children: "test" })
61
+ it('provides ContainerContext', async () => {
62
+ const Container = (await import('../Container')).default
63
+ Container({ columns: 12, gap: 16, children: 'test' })
64
64
  expect(mockProvide).toHaveBeenCalledTimes(1)
65
65
  })
66
66
 
67
- it("provides context with grid values", async () => {
68
- const Container = (await import("../Container")).default
69
- Container({ columns: 24, gap: 16, gutter: 8, children: "test" })
67
+ it('provides context with grid values', async () => {
68
+ const Container = (await import('../Container')).default
69
+ Container({ columns: 24, gap: 16, gutter: 8, children: 'test' })
70
70
  const config = mockProvide.mock.calls[0]?.[1] as Record<string, unknown>
71
71
  expect(config.columns).toBe(24)
72
72
  expect(config.gap).toBe(16)
73
73
  expect(config.gutter).toBe(8)
74
74
  })
75
75
 
76
- it("uses width prop to override containerWidth", async () => {
77
- const Container = (await import("../Container")).default
78
- const result = asVNode(Container({ width: 960, children: "test" }))
76
+ it('uses width prop to override containerWidth', async () => {
77
+ const Container = (await import('../Container')).default
78
+ const result = asVNode(Container({ width: 960, children: 'test' }))
79
79
  expect((result.props.$coolgrid as Record<string, unknown>).width).toBe(960)
80
80
  })
81
81
 
82
- it("accepts width as function", async () => {
83
- const Container = (await import("../Container")).default
82
+ it('accepts width as function', async () => {
83
+ const Container = (await import('../Container')).default
84
84
  const widthFn = (_containerWidth: any) => 800
85
- const result = asVNode(Container({ width: widthFn as any, children: "test" }))
85
+ const result = asVNode(Container({ width: widthFn as any, children: 'test' }))
86
86
  expect((result.props.$coolgrid as Record<string, unknown>).width).toBe(800)
87
87
  })
88
88
 
89
- it("strips context keys from DOM props", async () => {
90
- const Container = (await import("../Container")).default
89
+ it('strips context keys from DOM props', async () => {
90
+ const Container = (await import('../Container')).default
91
91
  const result = asVNode(
92
92
  Container({
93
93
  columns: 12,
94
94
  gap: 16,
95
- "data-testid": "container",
96
- children: "test",
95
+ 'data-testid': 'container',
96
+ children: 'test',
97
97
  }),
98
98
  )
99
- expect(result.props["data-testid"]).toBe("container")
99
+ expect(result.props['data-testid']).toBe('container')
100
100
  })
101
101
 
102
- it("passes css as extraStyles in $coolgrid", async () => {
103
- const Container = (await import("../Container")).default
104
- const customCss = "background: red;"
105
- const result = asVNode(Container({ css: customCss, children: "test" }))
102
+ it('passes css as extraStyles in $coolgrid', async () => {
103
+ const Container = (await import('../Container')).default
104
+ const customCss = 'background: red;'
105
+ const result = asVNode(Container({ css: customCss, children: 'test' }))
106
106
  expect((result.props.$coolgrid as Record<string, unknown>).extraStyles).toBe(customCss)
107
107
  })
108
108
 
109
- it("provides context with all grid keys", async () => {
110
- const Container = (await import("../Container")).default
109
+ it('provides context with all grid keys', async () => {
110
+ const Container = (await import('../Container')).default
111
111
  Container({
112
112
  columns: 12,
113
113
  gap: 16,
114
114
  gutter: 8,
115
115
  padding: 4,
116
116
  size: 6,
117
- contentAlignX: "center",
118
- children: "test",
117
+ contentAlignX: 'center',
118
+ children: 'test',
119
119
  })
120
120
  const config = mockProvide.mock.calls[0]?.[1] as Record<string, unknown>
121
- expect(config).toHaveProperty("columns")
122
- expect(config).toHaveProperty("gap")
123
- expect(config).toHaveProperty("gutter")
124
- expect(config).toHaveProperty("padding")
125
- expect(config).toHaveProperty("size")
126
- expect(config).toHaveProperty("contentAlignX")
121
+ expect(config).toHaveProperty('columns')
122
+ expect(config).toHaveProperty('gap')
123
+ expect(config).toHaveProperty('gutter')
124
+ expect(config).toHaveProperty('padding')
125
+ expect(config).toHaveProperty('size')
126
+ expect(config).toHaveProperty('contentAlignX')
127
127
  })
128
128
 
129
- it("renders with data-coolgrid attribute in dev mode", async () => {
130
- const Container = (await import("../Container")).default
131
- const result = asVNode(Container({ children: "test" }))
132
- expect(result.props["data-coolgrid"]).toBe("container")
129
+ it('renders with data-coolgrid attribute in dev mode', async () => {
130
+ const Container = (await import('../Container')).default
131
+ const result = asVNode(Container({ children: 'test' }))
132
+ expect(result.props['data-coolgrid']).toBe('container')
133
133
  })
134
134
 
135
135
  it("passes component prop as 'as'", async () => {
136
- const Container = (await import("../Container")).default
136
+ const Container = (await import('../Container')).default
137
137
  const customComponent = (() => null) as any
138
- const result = asVNode(Container({ component: customComponent, children: "test" }))
138
+ const result = asVNode(Container({ component: customComponent, children: 'test' }))
139
139
  expect(result.props.as).toBe(customComponent)
140
140
  })
141
141
 
142
- it("renders children in VNode", async () => {
143
- const Container = (await import("../Container")).default
144
- const result = asVNode(Container({ children: "hello world" }))
142
+ it('renders children in VNode', async () => {
143
+ const Container = (await import('../Container')).default
144
+ const result = asVNode(Container({ children: 'hello world' }))
145
145
  expect(result.children).toBeDefined()
146
146
  })
147
147
  })
@@ -1,11 +1,11 @@
1
- import type { VNode } from "@pyreon/core"
2
- import { beforeEach, describe, expect, it, vi } from "vitest"
1
+ import type { VNode } from '@pyreon/core'
2
+ import { beforeEach, describe, expect, it, vi } from 'vitest'
3
3
 
4
4
  const mockProvide = vi.fn()
5
5
  const mockUseContext = vi.fn()
6
6
 
7
- vi.mock("@pyreon/core", async (importOriginal) => {
8
- const original = await importOriginal<typeof import("@pyreon/core")>()
7
+ vi.mock('@pyreon/core', async (importOriginal) => {
8
+ const original = await importOriginal<typeof import('@pyreon/core')>()
9
9
  return {
10
10
  ...original,
11
11
  provide: (...args: any[]) => {
@@ -22,114 +22,114 @@ vi.mock("@pyreon/core", async (importOriginal) => {
22
22
 
23
23
  const asVNode = (v: unknown) => v as VNode
24
24
 
25
- describe("Row", () => {
25
+ describe('Row', () => {
26
26
  beforeEach(() => {
27
27
  vi.clearAllMocks()
28
28
  // unistyle context returns empty theme, container context returns empty
29
29
  mockUseContext.mockReturnValue({})
30
30
  })
31
31
 
32
- it("returns a VNode", async () => {
33
- const Row = (await import("../Row")).default
34
- const result = asVNode(Row({ children: "test" }))
32
+ it('returns a VNode', async () => {
33
+ const Row = (await import('../Row')).default
34
+ const result = asVNode(Row({ children: 'test' }))
35
35
  expect(result).toBeDefined()
36
36
  expect(result.type).toBeDefined()
37
37
  })
38
38
 
39
- it("has correct displayName", async () => {
40
- const Row = (await import("../Row")).default
41
- expect(Row.displayName).toBe("@pyreon/coolgrid/Row")
39
+ it('has correct displayName', async () => {
40
+ const Row = (await import('../Row')).default
41
+ expect(Row.displayName).toBe('@pyreon/coolgrid/Row')
42
42
  })
43
43
 
44
- it("has correct pkgName", async () => {
45
- const Row = (await import("../Row")).default
46
- expect(Row.pkgName).toBe("@pyreon/coolgrid")
44
+ it('has correct pkgName', async () => {
45
+ const Row = (await import('../Row')).default
46
+ expect(Row.pkgName).toBe('@pyreon/coolgrid')
47
47
  })
48
48
 
49
- it("has PYREON__COMPONENT static", async () => {
50
- const Row = (await import("../Row")).default
51
- expect(Row.PYREON__COMPONENT).toBe("@pyreon/coolgrid/Row")
49
+ it('has PYREON__COMPONENT static', async () => {
50
+ const Row = (await import('../Row')).default
51
+ expect(Row.PYREON__COMPONENT).toBe('@pyreon/coolgrid/Row')
52
52
  })
53
53
 
54
- it("passes $coolgrid prop with row values", async () => {
55
- const Row = (await import("../Row")).default
56
- const result = asVNode(Row({ gap: 16, children: "test" }))
57
- expect(result.props).toHaveProperty("$coolgrid")
58
- expect(result.props.$coolgrid).toHaveProperty("gap")
54
+ it('passes $coolgrid prop with row values', async () => {
55
+ const Row = (await import('../Row')).default
56
+ const result = asVNode(Row({ gap: 16, children: 'test' }))
57
+ expect(result.props).toHaveProperty('$coolgrid')
58
+ expect(result.props.$coolgrid).toHaveProperty('gap')
59
59
  })
60
60
 
61
- it("provides RowContext", async () => {
62
- const Row = (await import("../Row")).default
63
- Row({ gap: 16, columns: 12, children: "test" })
61
+ it('provides RowContext', async () => {
62
+ const Row = (await import('../Row')).default
63
+ Row({ gap: 16, columns: 12, children: 'test' })
64
64
  expect(mockProvide).toHaveBeenCalledTimes(1)
65
65
  })
66
66
 
67
- it("provides context with grid values", async () => {
68
- const Row = (await import("../Row")).default
69
- Row({ columns: 24, gap: 16, gutter: 8, children: "test" })
67
+ it('provides context with grid values', async () => {
68
+ const Row = (await import('../Row')).default
69
+ Row({ columns: 24, gap: 16, gutter: 8, children: 'test' })
70
70
  const config = mockProvide.mock.calls[0]?.[1] as Record<string, unknown>
71
71
  expect(config.columns).toBe(24)
72
72
  expect(config.gap).toBe(16)
73
73
  expect(config.gutter).toBe(8)
74
74
  })
75
75
 
76
- it("passes contentAlignX to $coolgrid", async () => {
77
- const Row = (await import("../Row")).default
78
- const result = asVNode(Row({ contentAlignX: "center", children: "test" }))
79
- expect((result.props.$coolgrid as Record<string, unknown>).contentAlignX).toBe("center")
76
+ it('passes contentAlignX to $coolgrid', async () => {
77
+ const Row = (await import('../Row')).default
78
+ const result = asVNode(Row({ contentAlignX: 'center', children: 'test' }))
79
+ expect((result.props.$coolgrid as Record<string, unknown>).contentAlignX).toBe('center')
80
80
  })
81
81
 
82
- it("strips context keys from DOM props", async () => {
83
- const Row = (await import("../Row")).default
82
+ it('strips context keys from DOM props', async () => {
83
+ const Row = (await import('../Row')).default
84
84
  const result = asVNode(
85
85
  Row({
86
86
  columns: 12,
87
87
  gap: 16,
88
- "data-testid": "row",
89
- children: "test",
88
+ 'data-testid': 'row',
89
+ children: 'test',
90
90
  }),
91
91
  )
92
- expect(result.props["data-testid"]).toBe("row")
92
+ expect(result.props['data-testid']).toBe('row')
93
93
  })
94
94
 
95
- it("passes css as extraStyles in $coolgrid when provided", async () => {
96
- const Row = (await import("../Row")).default
97
- const customCss = "background: blue;"
98
- const result = asVNode(Row({ css: customCss, children: "test" }))
95
+ it('passes css as extraStyles in $coolgrid when provided', async () => {
96
+ const Row = (await import('../Row')).default
97
+ const customCss = 'background: blue;'
98
+ const result = asVNode(Row({ css: customCss, children: 'test' }))
99
99
  expect((result.props.$coolgrid as Record<string, unknown>).extraStyles).toBe(customCss)
100
100
  })
101
101
 
102
- it("passes gutter in $coolgrid", async () => {
103
- const Row = (await import("../Row")).default
104
- const result = asVNode(Row({ gutter: 24, children: "test" }))
102
+ it('passes gutter in $coolgrid', async () => {
103
+ const Row = (await import('../Row')).default
104
+ const result = asVNode(Row({ gutter: 24, children: 'test' }))
105
105
  expect((result.props.$coolgrid as Record<string, unknown>).gutter).toBe(24)
106
106
  })
107
107
 
108
- it("provides context including colCss and colComponent", async () => {
109
- const Row = (await import("../Row")).default
108
+ it('provides context including colCss and colComponent', async () => {
109
+ const Row = (await import('../Row')).default
110
110
  const colComp = (() => null) as any
111
- Row({ colCss: "color: red;", colComponent: colComp, children: "test" })
111
+ Row({ colCss: 'color: red;', colComponent: colComp, children: 'test' })
112
112
  const config = mockProvide.mock.calls[0]?.[1] as Record<string, unknown>
113
- expect(config.colCss).toBe("color: red;")
113
+ expect(config.colCss).toBe('color: red;')
114
114
  expect(config.colComponent).toBe(colComp)
115
115
  })
116
116
 
117
- it("renders with data-coolgrid attribute in dev mode", async () => {
118
- const Row = (await import("../Row")).default
119
- const result = asVNode(Row({ children: "test" }))
120
- expect(result.props["data-coolgrid"]).toBe("row")
117
+ it('renders with data-coolgrid attribute in dev mode', async () => {
118
+ const Row = (await import('../Row')).default
119
+ const result = asVNode(Row({ children: 'test' }))
120
+ expect(result.props['data-coolgrid']).toBe('row')
121
121
  })
122
122
 
123
123
  it("passes component prop as 'as'", async () => {
124
- const Row = (await import("../Row")).default
124
+ const Row = (await import('../Row')).default
125
125
  const customComponent = (() => null) as any
126
- const result = asVNode(Row({ component: customComponent, children: "test" }))
126
+ const result = asVNode(Row({ component: customComponent, children: 'test' }))
127
127
  expect(result.props.as).toBe(customComponent)
128
128
  })
129
129
 
130
- it("renders children in VNode", async () => {
131
- const Row = (await import("../Row")).default
132
- const result = asVNode(Row({ children: "hello" }))
130
+ it('renders children in VNode', async () => {
131
+ const Row = (await import('../Row')).default
132
+ const result = asVNode(Row({ children: 'hello' }))
133
133
  expect(result.children).toBeDefined()
134
134
  })
135
135
  })