Skip to content

Commit 26a517b

Browse files
committed
fix(lift): homepage was never provided under projectDetails when lifting
1 parent 3962a0b commit 26a517b

File tree

5 files changed

+11
-21
lines changed

5 files changed

+11
-21
lines changed

src/lifter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {fileTypes, mergeIntoExistingConfigFile} from '@form8ion/core';
22

3-
export default async function ({projectRoot, results: {projectDetails: {homepage} = {}, tags}}) {
3+
export default async function ({projectRoot, results: {homepage, tags}}) {
44
await mergeIntoExistingConfigFile({
55
format: fileTypes.YAML,
66
path: `${projectRoot}/.github`,

src/lifter.test.js

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ describe('lifter', () => {
1515
it('should set properties in the settings file', async () => {
1616
const result = await lift({
1717
projectRoot,
18-
results: {
19-
projectDetails: {homepage},
20-
tags
21-
}
18+
results: {homepage, tags}
2219
});
2320

2421
expect(result).toEqual({});
@@ -58,20 +55,14 @@ describe('lifter', () => {
5855
it('should not result in an error when tags are not provided in the results', async () => {
5956
await lift({
6057
projectRoot,
61-
results: {
62-
projectDetails: {homepage}
63-
}
58+
results: {homepage}
6459
});
6560

6661
expect(mergeIntoExistingConfigFile).toHaveBeenCalledWith({
6762
format: fileTypes.YAML,
6863
path: `${projectRoot}/.github`,
6964
name: 'settings',
70-
config: {
71-
repository: {
72-
homepage
73-
}
74-
}
65+
config: {repository: {homepage}}
7566
});
7667
});
7768
});

test/integration/features/lift.feature

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@ Feature: Lift
22

33
Scenario: Lift
44
Given the GitHub repository settings are managed by the repository-settings app
5-
And the scaffolder results include projectDetails
5+
And the scaffolder results include homepage
66
And the scaffolder results include tags
77
When scaffolder results are processed
88
Then properties are updated in the settings file
99

1010
Scenario: Lift w/o project details
1111
Given the GitHub repository settings are managed by the repository-settings app
1212
And the scaffolder results include tags
13-
But the scaffolder results do not include projectDetails
13+
But the scaffolder results do not include homepage
1414
When scaffolder results are processed
1515
Then properties are updated in the settings file
1616

1717
Scenario: Lift w/o tags
1818
Given the GitHub repository settings are managed by the repository-settings app
19-
And the scaffolder results include projectDetails
19+
And the scaffolder results include homepage
2020
But the scaffolder results do not include tags
2121
When scaffolder results are processed
2222
Then properties are updated in the settings file
@@ -25,7 +25,7 @@ Feature: Lift
2525
Scenario: Lift w/ existing tags and new tags
2626
Given the GitHub repository settings are managed by the repository-settings app
2727
And the existing settings file includes existing tags
28-
And the scaffolder results include projectDetails
28+
And the scaffolder results include homepage
2929
And the scaffolder results include tags
3030
When scaffolder results are processed
3131
Then properties are updated in the settings file

test/integration/features/step_definitions/common-steps.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ When('scaffolder results are processed', async function () {
4545
await lift({
4646
projectRoot: this.projectRoot,
4747
results: {
48-
projectDetails: this.projectDetails,
48+
homepage: this.homepage,
4949
tags: this.tags
5050
}
5151
});

test/integration/features/step_definitions/results-steps.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import {Given} from '@cucumber/cucumber';
22
import any from '@travi/any';
33

4-
Given('the scaffolder results do not include projectDetails', async function () {
4+
Given('the scaffolder results do not include homepage', async function () {
55
return undefined;
66
});
77

8-
Given('the scaffolder results include projectDetails', async function () {
8+
Given('the scaffolder results include homepage', async function () {
99
this.homepage = any.url();
10-
this.projectDetails = {homepage: this.homepage};
1110
});
1211

1312
Given('the scaffolder results include tags', async function () {

0 commit comments

Comments
 (0)