Skip to content

Commit 76534f9

Browse files
author
Mike Taylor
committed
Merge pull request #463 from /issues/449/1
Issue #449 - Tests for g to GitHub issues functionality
2 parents b528c00 + 9da2f4e commit 76534f9

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

tests/functional/lib/issue-list.js

+15
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,21 @@ define([
147147
.then(function (className) {
148148
assert.notInclude(className, 'is-active', 'Searching should clear all filters');
149149
});
150+
},
151+
152+
'pressing g goes to github issues': function() {
153+
return this.remote
154+
.setFindTimeout(intern.config.wc.pageLoadTimeout)
155+
.get(require.toUrl(url))
156+
.findByCssSelector('body').click()
157+
.type('g')
158+
.end()
159+
// look for the issues container on github.com/foo/bar/issues
160+
.findByCssSelector('.repo-container .issues-listing').isDisplayed()
161+
.then(function (isDisplayed) {
162+
assert.equal(isDisplayed, true, 'We\'re at GitHub now.');
163+
})
164+
.end();
150165
}
151166
});
152167
});

tests/functional/lib/issues.js

+21
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,27 @@ define([
6868
.then(function (text) {
6969
assert.include(text, '(404)', 'We\'re at the 404.');
7070
});
71+
},
72+
73+
'pressing g goes to the github issue page': function() {
74+
var issueNumber = 100;
75+
return this.remote
76+
.setFindTimeout(intern.config.wc.pageLoadTimeout)
77+
.get(require.toUrl(url(issueNumber)))
78+
.findByCssSelector('body').click()
79+
.type('g')
80+
.end()
81+
// look for the issue container on github.com/foo/bar/issues/N
82+
.findByCssSelector('.gh-header.issue').isDisplayed()
83+
.then(function (isDisplayed) {
84+
assert.equal(isDisplayed, true, 'We\'re at the GitHub issue page now.');
85+
})
86+
.end()
87+
.findByCssSelector('.gh-header-number').getVisibleText()
88+
.then(function(text) {
89+
var headerNumber = parseInt(text.slice(1), 10);
90+
assert.equal(headerNumber, issueNumber, 'GitHub issue number matches.');
91+
});
7192
}
7293

7394
});

0 commit comments

Comments
 (0)