-
-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regex filtering in logEntryEventStream component (#251)
* Fixes (some) of #212 by adding regular expression filtering to the logEntryEventStream component. Did some cleanup, as well
- Loading branch information
1 parent
6599810
commit 1ef671b
Showing
6 changed files
with
100 additions
and
85 deletions.
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 |
---|---|---|
|
@@ -112,7 +112,7 @@ describe('LogEntryEventStream tests', () => { | |
}); | ||
document.body.appendChild(element); | ||
await Promise.resolve(); | ||
const loggingLevelFilterDropdown = element.shadowRoot.querySelector('lightning-combobox[data-id="logging-level-filter"]'); | ||
const loggingLevelFilterDropdown = element.shadowRoot.querySelector('lightning-combobox[data-id="loggingLevelFilter"]'); | ||
loggingLevelFilterDropdown.value = loggingLevels.DEBUG; | ||
loggingLevelFilterDropdown.dispatchEvent(new CustomEvent('change')); | ||
|
||
|
@@ -136,7 +136,7 @@ describe('LogEntryEventStream tests', () => { | |
}); | ||
document.body.appendChild(element); | ||
await Promise.resolve(); | ||
const loggingLevelFilterDropdown = element.shadowRoot.querySelector('lightning-combobox[data-id="logging-level-filter"]'); | ||
const loggingLevelFilterDropdown = element.shadowRoot.querySelector('lightning-combobox[data-id="loggingLevelFilter"]'); | ||
loggingLevelFilterDropdown.value = loggingLevels.DEBUG; | ||
loggingLevelFilterDropdown.dispatchEvent(new CustomEvent('change')); | ||
|
||
|
@@ -159,7 +159,7 @@ describe('LogEntryEventStream tests', () => { | |
}); | ||
document.body.appendChild(element); | ||
await Promise.resolve(); | ||
const originTypeFilterDropdown = element.shadowRoot.querySelector('lightning-combobox[data-id="origin-type-filter"]'); | ||
const originTypeFilterDropdown = element.shadowRoot.querySelector('lightning-combobox[data-id="originTypeFilter"]'); | ||
originTypeFilterDropdown.value = 'Flow'; | ||
originTypeFilterDropdown.dispatchEvent(new CustomEvent('change')); | ||
|
||
|
@@ -182,7 +182,7 @@ describe('LogEntryEventStream tests', () => { | |
}); | ||
document.body.appendChild(element); | ||
await Promise.resolve(); | ||
const originTypeFilterDropdown = element.shadowRoot.querySelector('lightning-combobox[data-id="origin-type-filter"]'); | ||
const originTypeFilterDropdown = element.shadowRoot.querySelector('lightning-combobox[data-id="originTypeFilter"]'); | ||
originTypeFilterDropdown.value = 'Flow'; | ||
originTypeFilterDropdown.dispatchEvent(new CustomEvent('change')); | ||
|
||
|
@@ -204,7 +204,7 @@ describe('LogEntryEventStream tests', () => { | |
}); | ||
document.body.appendChild(element); | ||
await Promise.resolve(); | ||
const originLocationFilterDropdown = element.shadowRoot.querySelector('lightning-input[data-id="origin-location-filter"]'); | ||
const originLocationFilterDropdown = element.shadowRoot.querySelector('lightning-input[data-id="originLocationFilter"]'); | ||
originLocationFilterDropdown.value = 'SomeClass.someMethod'; | ||
originLocationFilterDropdown.dispatchEvent(new CustomEvent('change')); | ||
|
||
|
@@ -227,7 +227,7 @@ describe('LogEntryEventStream tests', () => { | |
}); | ||
document.body.appendChild(element); | ||
await Promise.resolve(); | ||
const originLocationFilterDropdown = element.shadowRoot.querySelector('lightning-input[data-id="origin-location-filter"]'); | ||
const originLocationFilterDropdown = element.shadowRoot.querySelector('lightning-input[data-id="originLocationFilter"]'); | ||
originLocationFilterDropdown.value = 'SomeClass.someMethod'; | ||
originLocationFilterDropdown.dispatchEvent(new CustomEvent('change')); | ||
|
||
|
@@ -249,7 +249,7 @@ describe('LogEntryEventStream tests', () => { | |
}); | ||
document.body.appendChild(element); | ||
await Promise.resolve(); | ||
const originLocationFilterDropdown = element.shadowRoot.querySelector('lightning-input[data-id="logged-by-filter"]'); | ||
const originLocationFilterDropdown = element.shadowRoot.querySelector('lightning-input[data-id="loggedByFilter"]'); | ||
originLocationFilterDropdown.value = '[email protected]'; | ||
originLocationFilterDropdown.dispatchEvent(new CustomEvent('change')); | ||
|
||
|
@@ -272,7 +272,7 @@ describe('LogEntryEventStream tests', () => { | |
}); | ||
document.body.appendChild(element); | ||
await Promise.resolve(); | ||
const originLocationFilterDropdown = element.shadowRoot.querySelector('lightning-input[data-id="logged-by-filter"]'); | ||
const originLocationFilterDropdown = element.shadowRoot.querySelector('lightning-input[data-id="loggedByFilter"]'); | ||
originLocationFilterDropdown.value = '[email protected]'; | ||
originLocationFilterDropdown.dispatchEvent(new CustomEvent('change')); | ||
|
||
|
@@ -288,13 +288,13 @@ describe('LogEntryEventStream tests', () => { | |
const eventStreamDiv = element.shadowRoot.querySelector('.event-stream'); | ||
expect(eventStreamDiv.textContent).toBeFalsy(); | ||
}); | ||
it('includes matching log entry event for message filter', async () => { | ||
it('includes matching log entry event using string for message filter', async () => { | ||
const element = createElement('log-entry-event-stream', { | ||
is: LogEntryEventStream | ||
}); | ||
document.body.appendChild(element); | ||
await Promise.resolve(); | ||
const messageFilterTextarea = element.shadowRoot.querySelector('lightning-textarea[data-id="message-filter"]'); | ||
const messageFilterTextarea = element.shadowRoot.querySelector('lightning-textarea[data-id="messageFilter"]'); | ||
messageFilterTextarea.value = 'matching text'; | ||
messageFilterTextarea.dispatchEvent(new CustomEvent('change')); | ||
|
||
|
@@ -317,7 +317,7 @@ describe('LogEntryEventStream tests', () => { | |
}); | ||
document.body.appendChild(element); | ||
await Promise.resolve(); | ||
const messageFilterTextarea = element.shadowRoot.querySelector('lightning-textarea[data-id="message-filter"]'); | ||
const messageFilterTextarea = element.shadowRoot.querySelector('lightning-textarea[data-id="messageFilter"]'); | ||
messageFilterTextarea.value = 'non-matching text'; | ||
messageFilterTextarea.dispatchEvent(new CustomEvent('change')); | ||
|
||
|
@@ -333,4 +333,28 @@ describe('LogEntryEventStream tests', () => { | |
const eventStreamDiv = element.shadowRoot.querySelector('.event-stream'); | ||
expect(eventStreamDiv.textContent).toBeFalsy(); | ||
}); | ||
|
||
it('includes matching log entry event using regex for message filter', async () => { | ||
const element = createElement('log-entry-event-stream', { | ||
is: LogEntryEventStream | ||
}); | ||
document.body.appendChild(element); | ||
await Promise.resolve(); | ||
|
||
const messageFilterTextarea = element.shadowRoot.querySelector('lightning-textarea[data-id="messageFilter"]'); | ||
messageFilterTextarea.value = 'Something.+? blah$'; | ||
messageFilterTextarea.dispatchEvent(new CustomEvent('change')); | ||
|
||
const matchingLogEntryEvent = { ...mockLogEntryEventTemplate }; | ||
matchingLogEntryEvent.Message__c = 'Something, something, something, beep boop beep!!!!!!!%@#$!%, blah, blah, blah'; | ||
await jestMockPublish('/event/LogEntryEvent__e', { | ||
data: { | ||
payload: matchingLogEntryEvent | ||
} | ||
}); | ||
|
||
const expectedStreamText = getPlatformEventText(matchingLogEntryEvent); | ||
const eventStreamDiv = element.shadowRoot.querySelector('.event-stream'); | ||
expect(eventStreamDiv.textContent).toBe(expectedStreamText); | ||
}); | ||
}); |
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
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 |
---|---|---|
|
@@ -60,7 +60,7 @@ | |
"Nebula Logger - Unlocked [email protected]": "04t5Y0000015l27QAA", | ||
"Nebula Logger - Unlocked [email protected],-reports,-and-error-email-alerts": "04t5Y0000015l2qQAA", | ||
"Nebula Logger - Unlocked [email protected]": "04t5Y0000015l3oQAA", | ||
"Nebula Logger - Unlocked [email protected]": "04t5Y0000015l43QAA", | ||
"Nebula Logger - Unlocked [email protected]": "04t5Y0000015l48QAA", | ||
"Nebula Logger - Unlocked [email protected]": "04t5Y0000015kgPQAQ", | ||
"Nebula Logger - Unlocked [email protected]": "04t5Y0000015kgeQAA", | ||
"Nebula Logger - Unlocked [email protected]": "04t5Y0000015kgjQAA", | ||
|