Skip to content

Commit

Permalink
#870: fix bad whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
JoernBerkefeld committed Jul 7, 2023
1 parent 0e49714 commit 3bfa69c
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/metadataTypes/Automation.js
Original file line number Diff line number Diff line change
Expand Up @@ -1236,7 +1236,7 @@ class Automation extends MetadataType {
output += `**Schedule:**\n\n`;
output += `* Start: ${json.schedule.startDate.split('T').join(' ')} ${tz}\n`;
output += `* End: ${json.schedule.endDate.split('T').join(' ')} ${tz}\n`;
output += `* Timezone: ${json.schedule.timezoneName}\n`;
output += `* Timezone: ${json.schedule.timezoneName}\n`;

const ical = {};
for (const item of json.schedule.icalRecur.split(';')) {
Expand All @@ -1247,7 +1247,7 @@ class Automation extends MetadataType {

output += `* Recurrance: every ${ical.INTERVAL > 1 ? ical.INTERVAL : ''} ${
frequency === 'dai' ? 'day' : frequency
}${ical.INTERVAL > 1 ? 's' : ''} ${ical.COUNT ? `for ${ical.COUNT} times` : ''}\n`;
}${ical.INTERVAL > 1 ? 's' : ''}${ical.COUNT ? ` for ${ical.COUNT} times` : ''}\n`;
} else if (json.schedule) {
output += `**Schedule:** Not defined\n`;
}
Expand Down
2 changes: 1 addition & 1 deletion test/resources/9999999/automation/create-expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"r__folder_Path": "my automations",
"type": "scheduled",
"status": "PausedSchedule",
"schedule": {
"schedule": {
"endDate": "2079-06-06T21:00:00-06:00",
"icalRecur": "FREQ=MINUTELY;UNTIL=20790607T050000;INTERVAL=5",
"startDate": "2020-05-13T18:30:32.11-06:00",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

* Start: 2020-05-13 18:30:32.11-06:00 +01:00
* End: 2079-06-06 21:00:00-06:00 +01:00
* Timezone: W. Europe Standard Time
* Timezone: W. Europe Standard Time
* Recurrance: every 5 minutes

**Notifications:** _none_
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

* Start: 2022-07-30 00:00:00 +01:00
* End: 2022-07-30 00:00:00 +01:00
* Timezone: W. Europe Standard Time
* Timezone: W. Europe Standard Time
* Recurrance: every day for 1 times

**Notifications:**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

* Start: 2022-07-30 00:00:00 +01:00
* End: 2022-07-30 00:00:00 +01:00
* Timezone: W. Europe Standard Time
* Timezone: W. Europe Standard Time
* Recurrance: every day for 1 times

**Notifications:** _none_
Expand Down
12 changes: 12 additions & 0 deletions test/type.automation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,18 @@ describe('type: automation', () => {
)
);

// check if MD file was created and equals expectations
expect(file(testUtils.getActualDoc('testNew_automation', 'automation'))).to.equal(
file(
testUtils.getExpectedFile(
'9999999',
'automation',
'create-testNew_automation',
'md'
)
)
);

assert.equal(
testUtils.getAPIHistoryLength(),
16,
Expand Down

0 comments on commit 3bfa69c

Please sign in to comment.