File tree Expand file tree Collapse file tree 1 file changed +55
-0
lines changed Expand file tree Collapse file tree 1 file changed +55
-0
lines changed Original file line number Diff line number Diff line change
1
+ describe ( 'Repo' , ( ) => {
2
+ beforeEach ( ( ) => {
3
+ cy . visit ( '/admin/repo' ) ;
4
+
5
+ // prevent failures on 404 request and uncaught promises
6
+ cy . on ( 'uncaught:exception' , ( ) => false ) ;
7
+ } ) ;
8
+
9
+ describe ( 'Code button for repo row' , ( ) => {
10
+ it ( 'Opens tooltip with correct content and can copy' , ( ) => {
11
+ const cloneURL = 'http://localhost:8000/finos/test-repo.git' ;
12
+ const tooltipQuery = 'div[role="tooltip"]' ;
13
+
14
+ cy
15
+ // tooltip isn't open to start with
16
+ . get ( tooltipQuery )
17
+ . should ( 'not.exist' ) ;
18
+
19
+ cy
20
+ // find the entry for finos/test-repo
21
+ . get ( 'a[href="/admin/repo/test-repo"]' )
22
+ // take it's parent row
23
+ . closest ( 'tr' )
24
+ // find the nearby span containing Code we can click to open the tooltip
25
+ . find ( 'span' )
26
+ . contains ( 'Code' )
27
+ . should ( 'exist' )
28
+ . click ( ) ;
29
+
30
+ cy
31
+ // find the newly opened tooltip
32
+ . get ( tooltipQuery )
33
+ . should ( 'exist' )
34
+ . find ( 'span' )
35
+ // check it contains the url we expect
36
+ . contains ( cloneURL )
37
+ . should ( 'exist' )
38
+ . parent ( )
39
+ // find the adjacent span that contains the svg
40
+ . find ( 'span' )
41
+ . next ( )
42
+ // check it has the copy icon first and click it
43
+ . get ( 'svg.octicon-copy' )
44
+ . should ( 'exist' )
45
+ . click ( )
46
+ // check the icon has changed to the check icon
47
+ . get ( 'svg.octicon-copy' )
48
+ . should ( 'not.exist' )
49
+ . get ( 'svg.octicon-check' )
50
+ . should ( 'exist' ) ;
51
+
52
+ // failed to successfully check the clipboard
53
+ } ) ;
54
+ } ) ;
55
+ } ) ;
You can’t perform that action at this time.
0 commit comments