diff --git a/src/resources/Users.ts b/src/resources/Users.ts index a4bde28..d2ee448 100644 --- a/src/resources/Users.ts +++ b/src/resources/Users.ts @@ -14,9 +14,9 @@ export default class Users extends BaseCrud< constructor(bexioAuth: OAuth2) { super( bexioAuth, - "/timesheet_status", - Scopes.MONITORING_SHOW, - Scopes.MONITORING_EDIT + "/user", + Scopes.GENERAL, + Scopes.GENERAL ); } @@ -25,13 +25,13 @@ export default class Users extends BaseCrud< * * @param {number} id * @param {{}} ressource - * @returns {Promise} + * @returns {Promise} * @memberof Users */ public async overwrite( id: number, ressource: {} - ): Promise { + ): Promise { throw new Error("not implemented by Bexio yet"); } @@ -40,13 +40,13 @@ export default class Users extends BaseCrud< * * @param {number} id * @param {{}} ressource - * @returns {Promise} + * @returns {Promise} * @memberof Users */ public async edit( id: number, ressource: {} - ): Promise { + ): Promise { throw new Error("not implemented by Bexio yet"); } @@ -54,11 +54,11 @@ export default class Users extends BaseCrud< * Not implemented by Bexio yet * * @param {{}} ressource - * @returns {Promise} + * @returns {Promise} * @memberof Users */ public async create(ressource: {}): Promise< - UsersStatic.UserSmall + UsersStatic.UserFull > { throw new Error("not implemented by Bexio yet"); } diff --git a/src/tests/Users.test.ts b/src/tests/Users.test.ts index 9f818e0..a2f47de 100644 --- a/src/tests/Users.test.ts +++ b/src/tests/Users.test.ts @@ -35,7 +35,7 @@ describe("Users", function() { BEXIO_CLIENTID, BEXIO_CLIENTSECRET, `http://${HOSTNAME}/callback`, - [Scopes.MONITORING_EDIT, Scopes.MONITORING_SHOW] + [Scopes.GENERAL, Scopes.GENERAL] ); await api.fakeLogin(BEXIO_USERNAME, BEXIO_PASSWORD); }); @@ -53,8 +53,8 @@ describe("Users", function() { it("should return a not implemented error on creation", async () => { user = { id: 1, - firstname: "Alice", - lastname: "Bob", + firstname: "Mathias", + lastname: "Scherer", is_superadmin: false, color: "#ff00ff" }; @@ -67,13 +67,12 @@ describe("Users", function() { } }); - it("list useres", async () => { + it("list users", async () => { const list = await moduleToTest.list({}); expect(list.map(el => el.id)).includes(user.id); }); - // search is currently broken on bexio side - it.skip("search users", async () => { + it("search users", async () => { const searchResult = await moduleToTest.search({}, [ { field: