washday-sdk 1.6.36 → 1.6.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/api/index.js CHANGED
@@ -113,7 +113,7 @@ const WashdayClient = function WashdayClient(apiToken, env = 'PROD', clientId, c
113
113
  regularUserLogin: authEndpoints.postModule.regularUserLogin,
114
114
  pinLogin: authEndpoints.postModule.pinLogin,
115
115
  regularUserTokenLogin: authEndpoints.postModule.regularUserTokenLogin,
116
- forgotPassword: authEndpoints.postModule.customersAppForgotPassword,
116
+ forgotPassword: authEndpoints.postModule.forgotPassword,
117
117
  customersAppForgotPassword: authEndpoints.postModule.customersAppForgotPassword,
118
118
  customersAppChangePassword: authEndpoints.postModule.customersAppChangePassword,
119
119
  companySignUp: authEndpoints.postModule.companySignUp,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "1.6.36",
3
+ "version": "1.6.37",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
package/src/api/index.ts CHANGED
@@ -120,7 +120,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
120
120
  regularUserLogin: authEndpoints.postModule.regularUserLogin,
121
121
  pinLogin: authEndpoints.postModule.pinLogin,
122
122
  regularUserTokenLogin: authEndpoints.postModule.regularUserTokenLogin,
123
- forgotPassword: authEndpoints.postModule.customersAppForgotPassword,
123
+ forgotPassword: authEndpoints.postModule.forgotPassword,
124
124
  customersAppForgotPassword: authEndpoints.postModule.customersAppForgotPassword,
125
125
  customersAppChangePassword: authEndpoints.postModule.customersAppChangePassword,
126
126
  companySignUp: authEndpoints.postModule.companySignUp,
@@ -0,0 +1,42 @@
1
+ const mockPost = jest.fn().mockResolvedValue({
2
+ data: {
3
+ data: {
4
+ ok: true,
5
+ },
6
+ },
7
+ });
8
+
9
+ jest.mock("../src/api/axiosInstance", () => ({
10
+ __esModule: true,
11
+ getAxiosInstance: jest.fn(() => ({
12
+ post: mockPost,
13
+ interceptors: {
14
+ request: {
15
+ use: jest.fn(),
16
+ },
17
+ },
18
+ })),
19
+ }));
20
+
21
+ import WashdayClient from "../src/api";
22
+
23
+ describe("WashdayClient auth bindings", () => {
24
+ beforeEach(() => {
25
+ jest.clearAllMocks();
26
+ mockPost.mockClear();
27
+ });
28
+
29
+ it("binds auth.forgotPassword to the regular user endpoint", async () => {
30
+ const client = new (WashdayClient as any)("");
31
+
32
+ await client.auth.forgotPassword({
33
+ email: "rene@washday.mx",
34
+ });
35
+
36
+ expect(mockPost).toHaveBeenCalledWith(
37
+ "api/auth/forget-password",
38
+ { email: "rene@washday.mx" },
39
+ {}
40
+ );
41
+ });
42
+ });