-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Empty rows in the expressions configuration don't result in any…
…-regexps
- Loading branch information
Showing
3 changed files
with
149 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,4 +28,13 @@ describe('The Configuration API', (): void => { | |
|
||
chai.expect(configuration.notificationFrom).to.eq('Notification <[email protected]>') | ||
}) | ||
it('supports empty exclusion lines', async (): Promise<void> => { | ||
const mockServer = new MockServer('https://example.com') | ||
mockServer.addConfigurationDocumentEndpoint() | ||
|
||
const configuration = new Configuration('https://example.com', 'nobody', 'nothing', '12346') | ||
await configuration.load() | ||
|
||
chai.expect(configuration.exceptions).to.have.lengthOf(0) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,6 +142,143 @@ export class MockServer { | |
</table> | ||
</ac:rich-text-body> | ||
</ac:structured-macro> | ||
<ac:structured-macro ac:name='panel' ac:schema-version='1' ac:macro-id='93f1d981-c841-4cb4-b6e2-5940dfe69132'> | ||
<ac:parameter ac:name='title'>Notification Template</ac:parameter> | ||
<ac:rich-text-body> | ||
<ac:structured-macro ac:name='panel' ac:schema-version='1' ac:macro-id='f8503e48-c671-4ed6-897c-def2b2c3fa29'> | ||
<ac:parameter ac:name='title'>Subject</ac:parameter> | ||
<ac:rich-text-body><p>${MockServer.NOTIFICATION_SUBJECT}</p></ac:rich-text-body> | ||
</ac:structured-macro> | ||
<ac:structured-macro ac:name='panel' ac:schema-version='1' ac:macro-id='63c16112-dea3-434e-b1cb-467ff4e36d5f'> | ||
<ac:parameter ac:name='title'>Body</ac:parameter> | ||
<ac:rich-text-body>${MockServer.NOTIFICATION_BODY}</ac:rich-text-body> | ||
</ac:structured-macro> | ||
</ac:rich-text-body> | ||
</ac:structured-macro> | ||
`, | ||
}, | ||
}, | ||
}) | ||
this._scope | ||
.get('/rest/api/content/12346?expand=body.storage') | ||
.basicAuth({ | ||
user: 'nobody', | ||
pass: 'nothing', | ||
}) | ||
.reply(200, { | ||
body: { | ||
storage: { | ||
value: ` | ||
<ac:structured-macro ac:name='panel' ac:schema-version='1' ac:macro-id='4671afbe-d914-470a-bb9e-8b7321f60f79'> | ||
<ac:parameter ac:name='title'>Configuration</ac:parameter> | ||
<ac:rich-text-body> | ||
<table class='wrapped'> | ||
<colgroup> | ||
<col/> | ||
<col/> | ||
</colgroup> | ||
<tbody> | ||
<tr> | ||
<th>Space</th> | ||
<td>SAMPLE</td> | ||
</tr> | ||
<tr> | ||
<th>Domain</th> | ||
<td>example.com</td> | ||
</tr> | ||
<tr> | ||
<th>NotificationFrom</th> | ||
<td>Notification <[email protected]></td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</ac:rich-text-body> | ||
</ac:structured-macro> | ||
<ac:structured-macro ac:name='panel' ac:schema-version='1' ac:macro-id='ecfe796e-b701-4f30-a74a-b94dbb33daff'> | ||
<ac:parameter ac:name='title'>SMTP</ac:parameter> | ||
<ac:rich-text-body> | ||
<table> | ||
<colgroup> | ||
<col/> | ||
<col/> | ||
</colgroup> | ||
<tbody> | ||
<tr> | ||
<th>Host</th> | ||
<td colspan='1'>localhost</td> | ||
</tr> | ||
<tr> | ||
<th>Port</th> | ||
<td colspan='1'>25</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</ac:rich-text-body> | ||
</ac:structured-macro> | ||
<ac:structured-macro ac:name='panel' ac:schema-version='1' ac:macro-id='f19cd8b2-57e0-4c68-a823-8a2daee08c12'> | ||
<ac:parameter ac:name='title'>Checks</ac:parameter> | ||
<ac:rich-text-body> | ||
<table class='wrapped'> | ||
<colgroup> | ||
<col/> | ||
<col/> | ||
</colgroup> | ||
<tbody> | ||
<tr> | ||
<th>Labels</th> | ||
<th>MaxAge</th> | ||
</tr> | ||
<tr> | ||
<td>test1</td> | ||
<td>356</td> | ||
</tr> | ||
<tr> | ||
<td colspan='1'>test2</td> | ||
<td colspan='1'>1234</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</ac:rich-text-body> | ||
</ac:structured-macro> | ||
<ac:structured-macro ac:name='panel' ac:schema-version='1' ac:macro-id='1d192d60-7e69-4af8-8dd6-4006a7bfc952'> | ||
<ac:parameter ac:name='title'>Maintainer</ac:parameter> | ||
<ac:rich-text-body> | ||
<table class='wrapped'> | ||
<colgroup> | ||
<col/> | ||
<col/> | ||
</colgroup> | ||
<tbody> | ||
<tr> | ||
<th>Pagepattern</th> | ||
<th>Maintainer</th> | ||
</tr> | ||
<tr> | ||
<td>main/Test/.*</td> | ||
<td>maintainer,_lastauthor</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</ac:rich-text-body> | ||
</ac:structured-macro> | ||
<ac:structured-macro ac:name='panel' ac:schema-version='1' ac:macro-id='1d192d60-7e69-4af8-8dd6-4006a7bfc952'> | ||
<ac:parameter ac:name='title'>Exceptions</ac:parameter> | ||
<ac:rich-text-body> | ||
<table class='wrapped'> | ||
<colgroup> | ||
<col/> | ||
</colgroup> | ||
<tbody> | ||
<tr> | ||
<th>RegularExpression</th> | ||
</tr> | ||
<tr> | ||
<td></td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</ac:rich-text-body> | ||
</ac:structured-macro> | ||
<ac:structured-macro ac:name='panel' ac:schema-version='1' ac:macro-id='93f1d981-c841-4cb4-b6e2-5940dfe69132'> | ||
<ac:parameter ac:name='title'>Notification Template</ac:parameter> | ||
<ac:rich-text-body> | ||
|