Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
bfd14f87
Commit
bfd14f87
authored
Aug 26, 2016
by
winniehell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check for existence of elements under test in application_spec.js (!6051)
parent
9704fa22
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
spec/javascripts/application_spec.js
spec/javascripts/application_spec.js
+7
-3
No files found.
spec/javascripts/application_spec.js
View file @
bfd14f87
...
@@ -13,17 +13,21 @@
...
@@ -13,17 +13,21 @@
gl
.
utils
.
preventDisabledButtons
();
gl
.
utils
.
preventDisabledButtons
();
isClicked
=
false
;
isClicked
=
false
;
$button
=
$
(
'
#test-button
'
);
$button
=
$
(
'
#test-button
'
);
expect
(
$button
).
toExist
();
$button
.
click
(
function
()
{
$button
.
click
(
function
()
{
return
isClicked
=
true
;
return
isClicked
=
true
;
});
});
$button
.
trigger
(
'
click
'
);
$button
.
trigger
(
'
click
'
);
return
expect
(
isClicked
).
toBe
(
false
);
return
expect
(
isClicked
).
toBe
(
false
);
});
});
return
it
(
'
should be on the same page if a disabled link clicked
'
,
function
()
{
var
locationBeforeLinkClick
;
it
(
'
should be on the same page if a disabled link clicked
'
,
function
()
{
var
locationBeforeLinkClick
,
$link
;
locationBeforeLinkClick
=
window
.
location
.
href
;
locationBeforeLinkClick
=
window
.
location
.
href
;
gl
.
utils
.
preventDisabledButtons
();
gl
.
utils
.
preventDisabledButtons
();
$
(
'
#test-link
'
).
click
();
$link
=
$
(
'
#test-link
'
);
expect
(
$link
).
toExist
();
$link
.
click
();
return
expect
(
window
.
location
.
href
).
toBe
(
locationBeforeLinkClick
);
return
expect
(
window
.
location
.
href
).
toBe
(
locationBeforeLinkClick
);
});
});
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment