Don’t show commit details when none present (#311)

Fixes #308
This commit is contained in:
Rhys Arkins 2017-06-16 09:46:57 +02:00 committed by GitHub
parent 345cf3e159
commit 439367e223
4 changed files with 9 additions and 6 deletions

View file

@ -7,10 +7,11 @@ This {{#if isGitHub}}Pull{{else}}Merge{{/if}} Request renovates the package grou
### Commits ### Commits
{{#each upgrades as |upgrade|}} {{#each upgrades as |upgrade|}}
{{#if upgrade.releases.length}}
<details> <details>
<summary>{{upgrade.githubName}}</summary> <summary>{{upgrade.githubName}}</summary>
{{#each upgrade.releases as |release|}} {{#each upgrade.releases as |release|}}
#### {{release.version}} #### {{release.version}}
{{#each release.commits as |commit|}} {{#each release.commits as |commit|}}
- [`{{commit.shortSha}}`]({{commit.url}}){{commit.message}} - [`{{commit.shortSha}}`]({{commit.url}}){{commit.message}}
@ -18,9 +19,9 @@ This {{#if isGitHub}}Pull{{else}}Merge{{/if}} Request renovates the package grou
{{/each}} {{/each}}
</details> </details>
{{/if}}
{{/each}} {{/each}}
<br />
<br /> <br />
This {{#if isGitHub}}PR{{else}}MR{{/if}} has been generated by [Renovate Bot](https://keylocation.sg/our-tech/renovate). This {{#if isGitHub}}PR{{else}}MR{{/if}} has been generated by [Renovate Bot](https://keylocation.sg/our-tech/renovate).

View file

@ -1,4 +1,5 @@
This {{#if isGitHub}}Pull{{else}}Merge{{/if}} Request updates dependency [{{depName}}]({{repositoryUrl}}) from version `{{currentVersion}}` to `{{newVersion}}` This {{#if isGitHub}}Pull{{else}}Merge{{/if}} Request updates dependency [{{depName}}]({{repositoryUrl}}) from version `{{currentVersion}}` to `{{newVersion}}`
{{#if releases.length}}
### Commits ### Commits
@ -13,8 +14,7 @@ This {{#if isGitHub}}Pull{{else}}Merge{{/if}} Request updates dependency [{{depN
{{/each}} {{/each}}
</details> </details>
{{/if}}
<br />
<br /> <br />
This {{#if isGitHub}}PR{{else}}MR{{/if}} has been generated by [Renovate Bot](https://keylocation.sg/our-tech/renovate). This {{#if isGitHub}}PR{{else}}MR{{/if}} has been generated by [Renovate Bot](https://keylocation.sg/our-tech/renovate).

View file

@ -0,0 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`workers/pr ensurePr(upgrades) should return unmodified existing PR 1`] = `Array []`;

View file

@ -99,8 +99,6 @@ describe('workers/pr', () => {
- [\`abcdefg\`](https://github.com/renovateapp/dummy/commit/abcdefghijklmnopqrstuvwxyz)foo [#3](https://github.com/renovateapp/dummy/issues/3) - [\`abcdefg\`](https://github.com/renovateapp/dummy/commit/abcdefghijklmnopqrstuvwxyz)foo [#3](https://github.com/renovateapp/dummy/issues/3)
</details> </details>
<br />
<br /> <br />
This PR has been generated by [Renovate Bot](https://keylocation.sg/our-tech/renovate).`, This PR has been generated by [Renovate Bot](https://keylocation.sg/our-tech/renovate).`,
@ -191,6 +189,7 @@ This PR has been generated by [Renovate Bot](https://keylocation.sg/our-tech/ren
config.api.getBranchPr = jest.fn(() => existingPr); config.api.getBranchPr = jest.fn(() => existingPr);
config.api.updatePr = jest.fn(); config.api.updatePr = jest.fn();
const pr = await prWorker.ensurePr([config]); const pr = await prWorker.ensurePr([config]);
expect(config.api.updatePr.mock.calls).toMatchSnapshot();
expect(config.api.updatePr.mock.calls.length).toBe(0); expect(config.api.updatePr.mock.calls.length).toBe(0);
expect(pr).toMatchObject(existingPr); expect(pr).toMatchObject(existingPr);
}); });