Skip to content

Commit 312e962

Browse files
add: tests
1 parent 62baf8e commit 312e962

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

app/helpers/github-link.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ export function githubLink([project, version, file, line], { isEdit = false }) {
1010
// Check if the project is 'ember' and adjust the tag only if the major version is >= 6 to match the Git tags
1111
const adjustedVersion =
1212
isEmberProject && majorVersion >= 6
13-
? `${baseVersion}-ember-source`
14-
: baseVersion;
13+
? `${baseVersion}-ember-source`
14+
: baseVersion;
1515

1616
if (isEdit) {
1717
return `https://github.com/${githubMap[project]}/edit/release${mainDir(

tests/unit/helpers/github-link-test.js

+11
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@ module('Unit | Helper | github link', function () {
1313
);
1414
});
1515

16+
test('should append "ember-source" to the version for git tags v6 and above', function (assert) {
17+
let result = githubLink(
18+
['ember', '6.0.0', 'ember-glimmer/lib/component.js', '35'],
19+
{}
20+
);
21+
assert.equal(
22+
result,
23+
'https://github.com/emberjs/ember.js/tree/v6.0.0-ember-source/ember-glimmer/lib/component.js#L35'
24+
);
25+
});
26+
1627
test('should render a github link for ember-data from file info', function (assert) {
1728
let result = githubLink(
1829
['ember-data', '2.10.0', 'addon/-private/adapters/errors.js', '10'],

0 commit comments

Comments
 (0)