add sanity tests for favourites list view

This commit is contained in:
Adina Parpalita
2017-11-15 14:43:12 +02:00
parent 836628dd97
commit ad438c8664
3 changed files with 130 additions and 0 deletions

View File

@@ -40,6 +40,18 @@ export class FavoritesApi extends RepoApi {
.catch(this.handleError);
}
addFavoriteById(nodeType: string, id: string): Promise<any> {
const data = [{
target: {
[nodeType]: {
guid: id
}
}
}];
return this.post(`/people/-me-/favorites`, { data })
.catch(this.handleError);
}
getFavorite(api: RepoClient, name: string): Promise<any> {
return api.nodes.getNodeByPath(name)
.then((response) => {