Skip to content

Commit f650939

Browse files
committed
Add tests and documentation for highlights
1 parent f5a597a commit f650939

File tree

3 files changed

+46
-1
lines changed

3 files changed

+46
-1
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,31 @@ await client.getPhotosByHashtag({ hashtag: 'unicorn' })
501501
- `first`: A `number` of records to return max is `49`
502502
- `after`: The query cursor `String` for pagination
503503
504+
### getHighlightReels(params)
505+
```js
506+
await client.getHighlightReels({ highlightReelIds: [highlightReelId] })
507+
```
508+
> This will return the data of multiple highlights
509+
- `params`
510+
- `highlightReelIds`: An array of highlight reel id
511+
512+
### getHighlightsByUsername(params)
513+
```js
514+
await client.getHighlightsByUsername({ username })
515+
```
516+
> This will return the highlights below a profile.
517+
- `params`
518+
- `username`: The username
519+
520+
### getHighlightItemsByReel(params)
521+
```js
522+
await client.getHighlightItemsByReel({ highlightReelId })
523+
```
524+
> This will return the highlight items based on the id of the highlight
525+
- `params`
526+
- `highlightReelId`: The higlight reel id
527+
528+
504529
## License
505530
506531
MIT © [Jesús Lobos](https://jlobos.com/)

helpers/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ module.exports = {
2424
full_name: 'XENIA',
2525
id: '184028108',
2626
pk: 184028108,
27-
username: 'xenia'
27+
username: 'xenia',
28+
highlightReelId: 17890694692269640
2829
}
2930
},
3031

test/index.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,25 @@ test('getStoryItemsByReel', async t => {
139139
t.true(Array.isArray(storyItems))
140140
})
141141

142+
test('getHighlightReels', async t => {
143+
const response = await client.getHighlightReels({ highlightReelIds: [users.Xenia.highlightReelId] })
144+
t.true(Array.isArray(response))
145+
})
146+
147+
test('getHighlightsByUsername', async t => {
148+
const highlightItems = await client.getHighlightsByUsername({
149+
username: users.Xenia.username
150+
})
151+
152+
t.true(Array.isArray(highlightItems))
153+
})
154+
155+
test('getHighlightItemsByReel', async t => {
156+
const highlightItems = await client.getHighlightItemsByReel({ highlightReelId: users.Xenia.highlightReelId })
157+
158+
t.true(Array.isArray(highlightItems))
159+
})
160+
142161
test('markStoryItemAsSeen', async t => {
143162
const storyItem = (
144163
await client.getStoryItemsByHashtag({

0 commit comments

Comments
 (0)