File tree 5 files changed +116
-11
lines changed
5 files changed +116
-11
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"baseUrl" : " http://localhost:3000" ,
3
- "testFiles" : " **/*.visual.js" ,
3
+ "testFiles" : " **/*.{spec, visual} .js" ,
4
4
"video" : false
5
5
}
Original file line number Diff line number Diff line change
1
+ /// <reference types="cypress" />
2
+
3
+ describe ( 'Sidebar: spec' , ( ) => {
4
+ it ( 'with a Modal' , ( ) => {
5
+ cy . visit ( '/maximize/sidebar-and-modal/' )
6
+
7
+ cy . get ( '[data-tid="button-modal-open"]' ) . click ( )
8
+ cy . get ( '[data-tid="modal-content"]' ) . should ( 'be.visible' )
9
+
10
+ cy . get ( '[data-tid="button-modal-close"]' ) . click ( )
11
+ cy . get ( '[data-tid="modal-content"]' ) . should ( 'not.be.visible' )
12
+
13
+ cy . get ( '[data-tid="button-sidebar-toggle"]' ) . click ( )
14
+ cy . get ( '[data-tid="sidebar-home"]' ) . click ( )
15
+ cy . get ( '[data-tid="sidebar"]' ) . should ( 'be.visible' )
16
+
17
+ cy . get ( '[data-tid="button-sidebar-toggle"]' ) . click ( )
18
+ cy . get ( '[data-tid="sidebar"]' ) . should ( 'not.be.visible' )
19
+ } )
20
+ } )
Original file line number Diff line number Diff line change
1
+ import React from 'react'
2
+ import {
3
+ Button ,
4
+ Grid ,
5
+ Header ,
6
+ Icon ,
7
+ Menu ,
8
+ Segment ,
9
+ Sidebar ,
10
+ Modal ,
11
+ } from 'semantic-ui-react'
12
+
13
+ const SidebarAndModal = ( ) => {
14
+ const [ visible , setVisible ] = React . useState ( false )
15
+
16
+ return (
17
+ < >
18
+ < Button
19
+ data-tid = 'button-sidebar-toggle'
20
+ onClick = { ( ) => setVisible ( ! visible ) }
21
+ >
22
+ Toggle
23
+ </ Button >
24
+ < Grid columns = { 1 } >
25
+ < Grid . Column > Hello world!</ Grid . Column >
26
+
27
+ < Grid . Column >
28
+ < Sidebar . Pushable as = { Segment } >
29
+ < Sidebar
30
+ as = { Menu }
31
+ animation = 'overlay'
32
+ data-tid = 'sidebar'
33
+ icon = 'labeled'
34
+ inverted
35
+ onHide = { ( ) => setVisible ( false ) }
36
+ vertical
37
+ visible = { visible }
38
+ width = 'thin'
39
+ >
40
+ < Menu . Item as = 'a' data-tid = 'sidebar-home' >
41
+ < Icon name = 'home' />
42
+ Home
43
+ </ Menu . Item >
44
+ < Menu . Item as = 'a' >
45
+ < Icon name = 'gamepad' />
46
+ Games
47
+ </ Menu . Item >
48
+ < Menu . Item as = 'a' >
49
+ < Icon name = 'camera' />
50
+ Channels
51
+ </ Menu . Item >
52
+ </ Sidebar >
53
+
54
+ < Sidebar . Pusher >
55
+ < Segment basic style = { { minHeight : '50vh' } } >
56
+ < Header as = 'h3' > Application Content</ Header >
57
+ < Modal
58
+ trigger = {
59
+ < Button data-tid = 'button-modal-open' > Show Modal</ Button >
60
+ }
61
+ header = 'Reminder!'
62
+ content = { {
63
+ content : 'Call Benjamin regarding the reports' ,
64
+ 'data-tid' : 'modal-content' ,
65
+ } }
66
+ actions = { [
67
+ 'Snooze' ,
68
+ {
69
+ key : 'done' ,
70
+ content : 'Done' ,
71
+ 'data-tid' : 'button-modal-close' ,
72
+ positive : true ,
73
+ } ,
74
+ ] }
75
+ />
76
+ </ Segment >
77
+ </ Sidebar . Pusher >
78
+ </ Sidebar . Pushable >
79
+ </ Grid . Column >
80
+ </ Grid >
81
+ </ >
82
+ )
83
+ }
84
+
85
+ export default SidebarAndModal
Original file line number Diff line number Diff line change 68
68
"homepage" : " https://github.com/Semantic-Org/Semantic-UI-React#readme" ,
69
69
"dependencies" : {
70
70
"@babel/runtime" : " ^7.10.5" ,
71
- "@fluentui/react-component-event-listener" : " ~0.51.5 " ,
72
- "@fluentui/react-component-ref" : " ~0.51.5 " ,
71
+ "@fluentui/react-component-event-listener" : " ~0.51.6 " ,
72
+ "@fluentui/react-component-ref" : " ~0.51.6 " ,
73
73
"@popperjs/core" : " ^2.6.0" ,
74
74
"@semantic-ui-react/event-stack" : " ^3.1.2" ,
75
75
"clsx" : " ^1.1.1" ,
Original file line number Diff line number Diff line change 1102
1102
enabled "2.0.x"
1103
1103
kuler "^2.0.0"
1104
1104
1105
- "@fluentui/react-component-event-listener@~0.51.5 ":
1106
- version "0.51.5 "
1107
- resolved "https://registry.yarnpkg.com/@fluentui/react-component-event-listener/-/react-component-event-listener-0.51.5 .tgz#cc744ef1a048604925c2a3cd4636638f3b65136c "
1108
- integrity sha512-GdKyWJJ/JE4YpE2XCl3ZcwM3fnsfat64M3KD5nrPJCp7CL8n7GR0RbacQqZZa8pd1A9Zp7mBhFm/kQxw52D+hA ==
1105
+ "@fluentui/react-component-event-listener@~0.51.6 ":
1106
+ version "0.51.6 "
1107
+ resolved "https://registry.yarnpkg.com/@fluentui/react-component-event-listener/-/react-component-event-listener-0.51.6 .tgz#8e193b8bb20570aed09581080f110f5a95b51432 "
1108
+ integrity sha512-XbT3p28N6Bz6TsQSf4drCqJNL133DUYCSvyiWsDl7Y5IWzAMKwGcc4nETxqjP07XvInD9fJW9vOqWFlpLBe1xg ==
1109
1109
dependencies:
1110
1110
"@babel/runtime" "^7.10.4"
1111
1111
1112
- "@fluentui/react-component-ref@~0.51.5 ":
1113
- version "0.51.5 "
1114
- resolved "https://registry.yarnpkg.com/@fluentui/react-component-ref/-/react-component-ref-0.51.5 .tgz#a6066223bb3e55439807ce541f28abb14b8850b8 "
1115
- integrity sha512-EwlQm7ohwdcX8uYYMic+1WSd1FJUByDID4LpUkb+fwoz1qCNEeMsAk8yjqvidOYUddC2LJfG35iEvZ2/Ae41Hg ==
1112
+ "@fluentui/react-component-ref@~0.51.6 ":
1113
+ version "0.51.6 "
1114
+ resolved "https://registry.yarnpkg.com/@fluentui/react-component-ref/-/react-component-ref-0.51.6 .tgz#ba1fc8a82a49f4775a043079ca8a234f3c02a1c4 "
1115
+ integrity sha512-FrUJKizIdL2PlUji5zMB3cTNICv/zk4/nbX6W9F+FmaEAozEm62MRZWOSAX83bnzPQX0OtPBYTenh+5dAI+BMA ==
1116
1116
dependencies:
1117
1117
"@babel/runtime" "^7.10.4"
1118
1118
react-is "^16.6.3"
You can’t perform that action at this time.
0 commit comments