-
Notifications
You must be signed in to change notification settings - Fork 0
/
useModal.test.tsx.snap
128 lines (123 loc) 路 3.28 KB
/
useModal.test.tsx.snap
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`useModal with a portal renders the modal within the portal 1`] = `
<div
data-testid="modal-wrapper"
>
<div
class="fixed inset-0 overflow-y-scroll md:overflow-y-auto z-modal min-h-full transition duration-200 flex flex-col justify-center items-center"
>
<div
class="absolute inset-0 bg-grey-dark opacity-40 transition duration-200"
data-testid="modal-overlay"
/>
<div
class="min-h-full max-h-full fixed inline-block md:overflow-y-auto overflow-y-scroll inset-x-0 md:min-h-auto md:align-middle md:inset-auto md:relative h-full md:h-auto rounded-4 bg-white"
role="dialog"
>
<div
class="absolute z-modalClose cursor-pointer right-modalClose top-modalClose"
data-testid="modal-close"
>
<svg
height="48"
viewBox="0 0 24 24"
width="48"
xmlns="http://www.w3.org/2000/svg"
>
<g
fill="none"
fill-rule="evenodd"
stroke="#232A36"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="1.2"
>
<path
d="M7 7l10 10M17 7L7 17"
/>
</g>
</svg>
</div>
<div
class="z-modal w-12/12 my-0 p-15 md:p-40 md:w-modal"
>
<div>
HERE BE DRAGONS
</div>
</div>
</div>
</div>
</div>
`;
exports[`useModal without portal closes the modal when pressing ESC 1`] = `
<div>
<button>
Open modal
</button>
</div>
`;
exports[`useModal without portal opens modal when clicking the button 1`] = `
<div>
HERE BE DRAGONS
</div>
`;
exports[`useModal without portal renders correct markup 1`] = `
<div>
<button>
Open modal
</button>
</div>
`;
exports[`useModal without portal renders the modal within the container 1`] = `
<div>
<div>
<button>
Open modal
</button>
<div
class="fixed inset-0 overflow-y-scroll md:overflow-y-auto z-modal min-h-full transition duration-200 flex flex-col justify-center items-center"
>
<div
class="absolute inset-0 bg-grey-dark opacity-40 transition duration-200"
data-testid="modal-overlay"
/>
<div
class="min-h-full max-h-full fixed inline-block md:overflow-y-auto overflow-y-scroll inset-x-0 md:min-h-auto md:align-middle md:inset-auto md:relative h-full md:h-auto rounded-4 bg-white"
role="dialog"
>
<div
class="absolute z-modalClose cursor-pointer right-modalClose top-modalClose"
data-testid="modal-close"
>
<svg
height="48"
viewBox="0 0 24 24"
width="48"
xmlns="http://www.w3.org/2000/svg"
>
<g
fill="none"
fill-rule="evenodd"
stroke="#232A36"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="1.2"
>
<path
d="M7 7l10 10M17 7L7 17"
/>
</g>
</svg>
</div>
<div
class="z-modal w-12/12 my-0 p-15 md:p-40 md:w-modal"
>
<div>
HERE BE DRAGONS
</div>
</div>
</div>
</div>
</div>
</div>
`;