forked from fauna-labs/fwitter
-
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.
- Loading branch information
Brecht De Rooms
committed
Apr 17, 2020
1 parent
869d9a8
commit c1a19a4
Showing
7 changed files
with
34 additions
and
38 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
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 |
---|---|---|
|
@@ -66,9 +66,9 @@ beforeEach(async () => { | |
await adminClient.query(DeleteAllRatelimiting) | ||
// register two test users | ||
await waitForIndexActive(adminClient, 'hashtags_and_users_by_wordparts') | ||
// we will search on the handles of users (the last parameter) | ||
await registerWithUser(adminClient, '[email protected]', 'testtest', 'Test1', 'MrStrawberry') | ||
await registerWithUser(adminClient, '[email protected]', 'testtest', 'Test1', 'SirPepper') | ||
// we will search on the names of users (the second last parameter) | ||
await registerWithUser(adminClient, '[email protected]', 'testtest', 'MrStrawberry', 'userHandle1') | ||
await registerWithUser(adminClient, '[email protected]', 'testtest', 'SirPepper', 'userHandle2') | ||
// and the hashtags | ||
await adminClient.query(CreateHashtags(['Berries'])) | ||
await adminClient.query(CreateHashtags(['Pepper', 'Raw Honey'])) | ||
|
@@ -105,30 +105,32 @@ it('We can autocomplete tags and user handles', function() { | |
}) | ||
}) | ||
.then(res => { | ||
return searchPeopleAndTags(loggedInClient, 'pppppppp').then(res => { | ||
return searchPeopleAndTags(loggedInClient, 'ppppppppppppppppppppp').then(res => { | ||
expect(res.length).toBe(1) // for very long names we have to type a longer part | ||
return res | ||
}) | ||
}) | ||
.then(res => { | ||
return searchPeopleAndTags(loggedInClient, 'berr').then(res => { | ||
expect(res.length).toBe(2) // we find the tag berries as well as the user MrStrawberry | ||
expect(res).toHaveProperty([0, 'handle'], 'MrStrawberry') | ||
expect(res).toHaveProperty([1, 'name'], 'Berries') | ||
expect(res).toHaveProperty([1, 'name'], 'MrStrawberry') | ||
expect(res).toHaveProperty([0, 'name'], 'Berries') | ||
return res | ||
}) | ||
}) | ||
.then(res => { | ||
return searchPeopleAndTags(loggedInClient, 'pe').then(res => { | ||
expect(res.length).toBe(2) // we find the tag Pepper as well as the user SirPepper | ||
expect(res).toHaveProperty([0, 'handle'], 'SirPepper') | ||
expect(res).toHaveProperty([1, 'name'], 'Pepper') | ||
expect(res).toHaveProperty([1, 'name'], 'SirPepper') | ||
expect(res).toHaveProperty([0, 'name'], 'Pepper') | ||
return res | ||
}) | ||
}) | ||
.catch(err => { | ||
console.error(err) | ||
console.log(err.requestResult.responseContent.errors) | ||
if (err.requestResult) { | ||
console.log(err.requestResult.responseContent.errors) | ||
} | ||
throw err | ||
}) | ||
) | ||
}, 60000) |
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