-
Notifications
You must be signed in to change notification settings - Fork 65
714 list view grid highlighting #1944
Changes from 8 commits
c4d394a
f05b9e2
c5422ea
9139b9d
9548a1f
78571b9
3035bea
af1a28d
482e186
8b39f20
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,14 @@ | ||
<div id="screenshot-grid"> | ||
<sky-grid fit="scroll" [data]="items"> | ||
<sky-grid fit="scroll" [data]="items" [highlightText]="highlightText"> | ||
<sky-grid-column field="column1" heading="Column1"></sky-grid-column> | ||
<sky-grid-column field="column2" heading="Column2"></sky-grid-column> | ||
<sky-grid-column field="column3" heading="Column3"></sky-grid-column> | ||
<sky-grid-column field="column3" heading="Column3" [excludeFromHighlighting]="true"></sky-grid-column> | ||
</sky-grid> | ||
</div> | ||
<button | ||
id="highlight-button" | ||
class="sky-btn sky-btn-primary" | ||
(click)="triggerHighlight()" | ||
> | ||
Trigger Highlight | ||
</button> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -196,6 +196,24 @@ describe('List View Grid Component', () => { | |
expect(firstHeading.textContent.trim()).toEqual('Column1'); | ||
})); | ||
|
||
it('should handle a search being applied', fakeAsync(() => { | ||
setupTest(); | ||
|
||
flush(); | ||
tick(); | ||
|
||
state.take(1).subscribe((current) => { | ||
dispatcher.searchSetText('searchText'); | ||
tick(); | ||
flush(); | ||
component.grid.currentSearchText.subscribe(currentText => { | ||
expect(currentText).toBe('searchText'); | ||
}); | ||
}); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you add a done() call or something to ensure the expect is always being hit? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can't mix Thoughts @blackbaud-conorwright? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, done will not be usable here. As long is this catches when the logic is removed it's fine :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I double checked and if the logic to updated currentSearchText is removed then the test fails |
||
|
||
tick(); | ||
})); | ||
|
||
describe('Models and State', () => { | ||
it('should run ListViewGridColumnsLoadAction action', async(() => { | ||
setupTest(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can highlightSearchText be a getter so that this logic could be handled in the ts file and included in coverage?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nevermind. The logic will be much worse, since currentSearchText is an observable. We will leave this as it is