File tree 3 files changed +118
-0
lines changed
source/library/components/py-box
3 files changed +118
-0
lines changed Original file line number Diff line number Diff line change
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports [` PyBox check if match snapshots with alpha pyscript provider 1` ] = `
4
+ <div >
5
+ <py-box
6
+ widths = " 2/3;1/6;1/6"
7
+ >
8
+ <div
9
+ data-testid = " first-element"
10
+ >
11
+ first
12
+ </div >
13
+ <div
14
+ data-testid = " second-element"
15
+ >
16
+ second
17
+ </div >
18
+ <div
19
+ data-testid = " third-element"
20
+ >
21
+ third
22
+ </div >
23
+ </py-box >
24
+ </div >
25
+ ` ;
26
+
27
+ exports [` PyBox check if match snapshots with set width 1` ] = `
28
+ <div >
29
+ <py-box
30
+ widths = " 2/3;1/6;1/6"
31
+ >
32
+ <div
33
+ data-testid = " first-element"
34
+ >
35
+ first
36
+ </div >
37
+ <div
38
+ data-testid = " second-element"
39
+ >
40
+ second
41
+ </div >
42
+ <div
43
+ data-testid = " third-element"
44
+ >
45
+ third
46
+ </div >
47
+ </py-box >
48
+ </div >
49
+ ` ;
50
+
51
+ exports [` PyBox check if match snapshots without pyscript provider 1` ] = `
52
+ <div >
53
+ <py-box />
54
+ </div >
55
+ ` ;
56
+
57
+ exports [` PyBox ensure that PyBox doesn't work with latest pyscript provider 1` ] = `
58
+ <div >
59
+ <py-box >
60
+ <div
61
+ data-testid = " first-element"
62
+ >
63
+ first
64
+ </div >
65
+ <div
66
+ data-testid = " second-element"
67
+ >
68
+ second
69
+ </div >
70
+ <div
71
+ data-testid = " third-element"
72
+ >
73
+ third
74
+ </div >
75
+ </py-box >
76
+ </div >
77
+ ` ;
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ PyBoxWithMultipleElementsExample.args = {
29
29
< div key = "element-2" > Second element</ div > ,
30
30
< div key = "element-3" > Third element</ div > ,
31
31
] ,
32
+ widths : "2/3;1/6;1/6" ,
32
33
} ;
33
34
34
35
export const PyBoxWithSingleElementExample : StoryFn < typeof PyBox > =
Original file line number Diff line number Diff line change
1
+ import { render } from "@testing-library/react" ;
2
+ import PyScriptProvider from "../py-script-provider" ;
3
+ import PyBox from "./py-box" ;
4
+
5
+ const children = [
6
+ < div data-testid = "first-element" key = "first-element" >
7
+ first
8
+ </ div > ,
9
+ < div data-testid = "second-element" key = "second-element" >
10
+ second
11
+ </ div > ,
12
+ < div data-testid = "third-element" key = "third-element" >
13
+ third
14
+ </ div > ,
15
+ ] ;
16
+ describe ( "PyBox" , ( ) => {
17
+ it ( "check if match snapshots without pyscript provider" , ( ) => {
18
+ const { container } = render ( < PyBox /> ) ;
19
+ expect ( container ) . toMatchSnapshot ( ) ;
20
+ } ) ;
21
+ it ( "check if match snapshots with alpha pyscript provider" , ( ) => {
22
+ const { container } = render (
23
+ < PyScriptProvider
24
+ jsSource = "https://pyscript.net/alpha/pyscript.js"
25
+ cssSource = "https://pyscript.net/alpha/pyscript.css"
26
+ >
27
+ < PyBox widths = "2/3;1/6;1/6" children = { children } />
28
+ </ PyScriptProvider > ,
29
+ ) ;
30
+ expect ( container ) . toMatchSnapshot ( ) ;
31
+ } ) ;
32
+ it ( "ensure that PyBox doesn't work with latest pyscript provider " , ( ) => {
33
+ const { container } = render (
34
+ < PyScriptProvider >
35
+ < PyBox children = { children } />
36
+ </ PyScriptProvider > ,
37
+ ) ;
38
+ expect ( container ) . toMatchSnapshot ( ) ;
39
+ } ) ;
40
+ } ) ;
You can’t perform that action at this time.
0 commit comments