Skip to content

Commit

Permalink
feat(SFINT-3521): lint
Browse files Browse the repository at this point in the history
  • Loading branch information
nlafrance-coveo committed Nov 16, 2020
1 parent f4e5f7a commit 936ef16
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions tests/components/AugmentedResultList/AugmentedResultList.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,19 @@ describe('AugmentedResultList', () => {
};

const testMatchingFunction = (augmentData: any, queryResult: IQueryResult) => {
return augmentData.type === 'water' && (augmentData.id === queryResult.raw.id);
}
return augmentData.type === 'water' && augmentData.id === queryResult.raw.id;
};

const createFakeResultsThatMatch = (numResults: number) => {
const fakeResults = Fake.createFakeResults(numResults);
fakeResults.results.forEach((result, index) => (result.raw.id = `#00${index}`));
return fakeResults;
};

const createComponent = (fetchAugmentData?: (objectIds: string[]) => Promise<IPromiseReturnArgs<IAugmentData>>, matchingFunction?: (augmentData: any, queryResult: IQueryResult) => boolean) => {
const createComponent = (
fetchAugmentData?: (objectIds: string[]) => Promise<IPromiseReturnArgs<IAugmentData>>,
matchingFunction?: (augmentData: any, queryResult: IQueryResult) => boolean
) => {
element = document.createElement('div');
document.body.append(element);
testOptions = new Mock.AdvancedComponentSetupOptions(element, {
Expand Down Expand Up @@ -153,9 +156,9 @@ describe('AugmentedResultList', () => {
test.cmp.buildResults(data).then(() => {
const displayedResults = test.cmp.getDisplayedResults();
expect(displayedResults.length).toEqual(numResults);
expect(displayedResults.find(result => result.raw.id === '#007').raw.name).toEqual('squirtle');
expect(displayedResults.find(result => result.raw.id === '#001').raw.name).toBeUndefined();
expect(displayedResults.find(result => result.raw.id === '#004').raw.name).toBeUndefined();
expect(displayedResults.find((result) => result.raw.id === '#007').raw.name).toEqual('squirtle');
expect(displayedResults.find((result) => result.raw.id === '#001').raw.name).toBeUndefined();
expect(displayedResults.find((result) => result.raw.id === '#004').raw.name).toBeUndefined();
done();
});
});
Expand Down

0 comments on commit 936ef16

Please sign in to comment.