Skip to content

Commit

Permalink
NO-TICKET - update test users url to new endpoint, update doc links t…
Browse files Browse the repository at this point in the history
…o be correct.
  • Loading branch information
austin-rausch committed Apr 13, 2021
1 parent d040870 commit 208143e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
facebook-test-users
===================

> Utilities for working with Facebook test users
> Utilities for working with Facebook test users, this package uses v10.0 of the Facebook graph-api. [link](https://developers.facebook.com/docs/graph-api/changelog/version10.0#graph-api)
[![Build Status](https://travis-ci.org/lifeomic/facebook-test-users.svg?branch=master)](https://travis-ci.org/lifeomic/facebook-test-users)
[![Coverage Status](https://coveralls.io/repos/github/lifeomic/facebook-test-users/badge.svg?branch=master)](https://coveralls.io/github/lifeomic/facebook-test-users?branch=master)
Expand Down Expand Up @@ -52,40 +52,40 @@ References:
### `async client.findTestUser(fields)`

Find a test user that matches the specified fields. Returns a
[description of the matching user][test-user-fields] augmented with the matched
[description of the matching user][user-fields] augmented with the matched
fields or `null` if no users matched the specified fields.

- **fields** — An object describing the fields that the test user must match.
Only fields from the [test user node][test-user-node] can be matched.
Only fields from the [user node][user-node] can be matched.

### `async client.getTestUser({ id, includeFields })`

Fetches the [test user node][test-user-node] for the user with the specified ID.
Returns the [test user node][test-user-node] with the specified fields.
Fetches the [user node][user-node] for the user with the specified ID.
Returns the [user node][user-node] with the specified fields.

- **id** — the ID of the user to retrieve
- **includeFields** _optional_ An array specifying the fields to include. Only
fields from the [test user node][test-user-node] may be specified.
fields from the [user node][user-node] may be specified.

References:
- [Lookup a Test User][test-user-node]
- [Lookup a Test User][user-node]

## `async client.listTestUsers({ includeFields })`

Get a list of all test users associated with the app. Returns a list of
[user descriptions][test-user-fields] augmented with any additional requested
[user descriptions][user-fields] augmented with any additional requested
fields.

- **includeFields** _optional_ An array specifying the fields to include. Only
fields from the [test user node][test-user-node] may be specified.
fields from the [user node][user-node] may be specified.

References:
- [Test Users][test-users]

[delete-test-user]: https://developers.facebook.com/docs/graph-api/reference/v3.0/test-user#deleting "Delete a Test User"
[publish-fields]: https://developers.facebook.com/docs/graph-api/reference/v3.0/app/accounts/test-users#pubfields "Test User Publish Fields"
[publish-response]: https://developers.facebook.com/docs/graph-api/reference/v3.0/app/accounts/test-users#pubresponse "Publish User Response"
[publish-user]: https://developers.facebook.com/docs/graph-api/reference/v3.0/app/accounts/test-users#publish "Create a Test User"
[test-user-fields]: https://developers.facebook.com/docs/graph-api/reference/v3.0/app/accounts/test-users#readfields " Test User Fields"
[test-user-node]: https://developers.facebook.com/docs/graph-api/reference/v3.0/test-user#read "Test User Node"
[test-users]: https://developers.facebook.com/docs/graph-api/reference/v3.0/app/accounts/test-users "Test Users"
[delete-test-user]: https://developers.facebook.com/docs/graph-api/reference/v10.0/application/accounts#Deleting "Delete a Test User"
[publish-fields]: https://developers.facebook.com/docs/graph-api/reference/v10.0/application/accounts#parameters-2 "Test User Publish Fields"
[publish-response]: https://developers.facebook.com/docs/graph-api/reference/v10.0/application/accounts#return-type "Publish User Response"
[publish-user]: https://developers.facebook.com/docs/graph-api/reference/v10.0/application/accounts#Creating "Create a Test User"
[user-fields]: https://developers.facebook.com/docs/graph-api/reference/v10.0/user#fields "User Fields"
[user-node]: https://developers.facebook.com/docs/graph-api/reference/v10.0/user#read "User Node"
[test-users]: https://developers.facebook.com/docs/graph-api/reference/v10.0/application/accounts#Reading "Test Users"
2 changes: 1 addition & 1 deletion src/testUsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Application {
}
});

this._testUsersUrl = `/${this._appId}/accounts/test-users`;
this._testUsersUrl = `/${this._appId}/accounts`;
}

async createTestUser (options = {}) {
Expand Down
6 changes: 3 additions & 3 deletions test/helpers/facebook.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ const provideTestUsers = ({ accessToken, appId, users }) => {
nock(GRAPH_API_HOST)
.persist()
.matchHeader('authorization', `Bearer ${accessToken}`)
.get((uri) => uri.startsWith(`${GRAPH_API_BASE}/${appId}/accounts/test-users`))
.get((uri) => uri.startsWith(`${GRAPH_API_BASE}/${appId}/accounts`))
.reply((uri) => {
const query = parseQueryString(uri);

const page = createPage({
after: query.get('after'),
items: users.map((user) => user.appView()),
url: `${GRAPH_API_HOST}${GRAPH_API_BASE}/${appId}/accounts/test-users`
url: `${GRAPH_API_HOST}${GRAPH_API_BASE}/${appId}/accounts`
});

return [ 200, page ];
Expand All @@ -69,7 +69,7 @@ const provideTestUsers = ({ accessToken, appId, users }) => {
nock(GRAPH_API_HOST)
.persist()
.matchHeader('authorization', `Bearer ${accessToken}`)
.post((uri) => uri.startsWith(`${GRAPH_API_BASE}/${appId}/accounts/test-users`))
.post((uri) => uri.startsWith(`${GRAPH_API_BASE}/${appId}/accounts`))
.reply((uri, body) => [ 200, users.createUser(body).publishView() ]);

nock(GRAPH_API_HOST)
Expand Down

0 comments on commit 208143e

Please sign in to comment.