@griddo/ax 11.10.46 → 11.10.47-rc.0
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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@griddo/ax",
|
|
3
3
|
"description": "Griddo Author Experience",
|
|
4
|
-
"version": "11.10.
|
|
4
|
+
"version": "11.10.47-rc.0",
|
|
5
5
|
"authors": [
|
|
6
6
|
"Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
|
|
7
7
|
"Diego M. Béjar <diego.bejar@secuoyas.com>",
|
|
@@ -217,5 +217,5 @@
|
|
|
217
217
|
"publishConfig": {
|
|
218
218
|
"access": "public"
|
|
219
219
|
},
|
|
220
|
-
"gitHead": "
|
|
220
|
+
"gitHead": "486216826a26ab0ebe02a4a676748e7208de906c"
|
|
221
221
|
}
|
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import axios from "axios";
|
|
3
|
-
import { ThemeProvider } from "styled-components";
|
|
4
|
-
import configureStore from "redux-mock-store";
|
|
5
|
-
import thunk from "redux-thunk";
|
|
6
1
|
import { Router } from "react-router-dom";
|
|
2
|
+
|
|
7
3
|
import "@testing-library/jest-dom";
|
|
8
|
-
import { render, cleanup, screen, act, waitFor } from "./../../../../../../config/jest/test-utils";
|
|
9
|
-
import userEvent from "@testing-library/user-event";
|
|
10
|
-
import { createMemoryHistory } from "history";
|
|
11
|
-
import MockAdapter from "axios-mock-adapter";
|
|
12
|
-
import { Middleware } from "redux";
|
|
13
4
|
|
|
14
5
|
import { parseTheme } from "@ax/helpers";
|
|
15
6
|
import globalTheme from "@ax/themes/theme.json";
|
|
16
|
-
import UserItem, { IUserItemProps } from "./../../../../../modules/Users/UserList/UserItem";
|
|
17
7
|
|
|
8
|
+
import userEvent from "@testing-library/user-event";
|
|
9
|
+
import axios from "axios";
|
|
10
|
+
import MockAdapter from "axios-mock-adapter";
|
|
11
|
+
import { createMemoryHistory } from "history";
|
|
12
|
+
import type { Middleware } from "redux";
|
|
13
|
+
import configureStore from "redux-mock-store";
|
|
14
|
+
import thunk from "redux-thunk";
|
|
15
|
+
import { ThemeProvider } from "styled-components";
|
|
16
|
+
|
|
17
|
+
import { act, cleanup, render, screen, waitFor } from "./../../../../../../config/jest/test-utils";
|
|
18
|
+
import { defaultStore } from "./../../../../../__mocks__/store/GenericStore";
|
|
18
19
|
import {
|
|
19
20
|
appStoreMock,
|
|
20
21
|
sitesStoreGlobalMock,
|
|
21
22
|
usersSiteStoreMock,
|
|
22
23
|
usersStoreMock,
|
|
23
24
|
} from "../../../../../__mocks__/store/UserList";
|
|
24
|
-
import {
|
|
25
|
+
import UserItem, { type IUserItemProps } from "./../../../../../modules/Users/UserList/UserItem";
|
|
25
26
|
|
|
26
27
|
const middlewares: Middleware[] = [thunk];
|
|
27
28
|
const mockStore = configureStore(middlewares);
|
|
@@ -338,7 +339,7 @@ describe("UserItem events", () => {
|
|
|
338
339
|
|
|
339
340
|
expect(screen.getByTestId("modal-delete-content")).toBeTruthy();
|
|
340
341
|
|
|
341
|
-
const deleteButton = screen.getByText("Delete
|
|
342
|
+
const deleteButton = screen.getByText("Delete");
|
|
342
343
|
await user.click(deleteButton);
|
|
343
344
|
|
|
344
345
|
await waitFor(() => expect(screen.queryByTestId("modal-delete-content")).toBeFalsy());
|
|
@@ -375,12 +376,12 @@ describe("UserItem events", () => {
|
|
|
375
376
|
const iconAction = screen.getByTestId("icon-action-component");
|
|
376
377
|
await user.click(iconAction);
|
|
377
378
|
|
|
378
|
-
const removeItem = screen.getByText("remove
|
|
379
|
+
const removeItem = screen.getByText("remove");
|
|
379
380
|
await user.click(removeItem);
|
|
380
381
|
|
|
381
382
|
expect(screen.getByTestId("modal-delete-content")).toBeTruthy();
|
|
382
383
|
|
|
383
|
-
const removeButton = screen.getByText("Remove
|
|
384
|
+
const removeButton = screen.getByText("Remove");
|
|
384
385
|
await user.click(removeButton);
|
|
385
386
|
await waitFor(() => expect(screen.queryByTestId("modal-delete-content")).toBeFalsy());
|
|
386
387
|
|
|
@@ -1,38 +1,37 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import axios from "axios";
|
|
3
|
-
import { ThemeProvider } from "styled-components";
|
|
4
|
-
import configureStore from "redux-mock-store";
|
|
5
|
-
import thunk from "redux-thunk";
|
|
6
1
|
import { Router } from "react-router-dom";
|
|
7
|
-
|
|
2
|
+
|
|
8
3
|
import "@testing-library/jest-dom";
|
|
9
|
-
import { render, cleanup, screen, act, fireEvent } from "./../../../../../config/jest/test-utils";
|
|
10
|
-
import userEvent from "@testing-library/user-event";
|
|
11
|
-
import { createMemoryHistory } from "history";
|
|
12
|
-
import MockAdapter from "axios-mock-adapter";
|
|
13
|
-
import { Middleware } from "redux";
|
|
14
4
|
|
|
15
5
|
import { parseTheme } from "@ax/helpers";
|
|
16
6
|
import globalTheme from "@ax/themes/theme.json";
|
|
17
|
-
import UserList, { IUserListProps } from "./../../../../modules/Users/UserList";
|
|
18
7
|
|
|
19
|
-
import
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
8
|
+
import userEvent from "@testing-library/user-event";
|
|
9
|
+
import axios from "axios";
|
|
10
|
+
import MockAdapter from "axios-mock-adapter";
|
|
11
|
+
import { createMemoryHistory } from "history";
|
|
12
|
+
import { mock } from "jest-mock-extended";
|
|
13
|
+
import type { Middleware } from "redux";
|
|
14
|
+
import configureStore from "redux-mock-store";
|
|
15
|
+
import thunk from "redux-thunk";
|
|
16
|
+
import { ThemeProvider } from "styled-components";
|
|
26
17
|
|
|
18
|
+
import { act, cleanup, fireEvent, render, screen } from "./../../../../../config/jest/test-utils";
|
|
27
19
|
import {
|
|
20
|
+
deletedUserResponse,
|
|
21
|
+
removeUserSiteResponse,
|
|
28
22
|
rolesResponse,
|
|
29
23
|
userResponse,
|
|
30
24
|
usersResponse,
|
|
31
|
-
deletedUserResponse,
|
|
32
|
-
removeUserResponse,
|
|
33
25
|
usersSiteResponse,
|
|
34
|
-
removeUserSiteResponse,
|
|
35
26
|
} from "./../../../../__mocks__/axios/UserList";
|
|
27
|
+
import {
|
|
28
|
+
appStoreMock,
|
|
29
|
+
sitesStoreGlobalMock,
|
|
30
|
+
sitesStoreMock,
|
|
31
|
+
usersSiteStoreMock,
|
|
32
|
+
usersStoreMock,
|
|
33
|
+
} from "../../../../__mocks__/store/UserList";
|
|
34
|
+
import UserList, { type IUserListProps } from "./../../../../modules/Users/UserList";
|
|
36
35
|
|
|
37
36
|
const middlewares: Middleware[] = [thunk];
|
|
38
37
|
const mockStore = configureStore(middlewares);
|
|
@@ -235,7 +234,7 @@ describe("UserList module events", () => {
|
|
|
235
234
|
expect(screen.getByTestId("user-delete-bulk-modal")).toBeTruthy();
|
|
236
235
|
|
|
237
236
|
await act(async () => {
|
|
238
|
-
fireEvent.click(screen.getByText("Delete
|
|
237
|
+
fireEvent.click(screen.getByText("Delete"));
|
|
239
238
|
});
|
|
240
239
|
|
|
241
240
|
expect(screen.queryByTestId("user-delete-bulk-modal")).toBeFalsy();
|
|
@@ -296,15 +295,10 @@ describe("UserList module events", () => {
|
|
|
296
295
|
|
|
297
296
|
await act(async () => {
|
|
298
297
|
const button = screen.getAllByText("Remove from this site");
|
|
299
|
-
fireEvent.click(button[
|
|
298
|
+
fireEvent.click(button[0]);
|
|
300
299
|
});
|
|
301
300
|
|
|
302
301
|
expect(screen.queryByTestId("user-delete-bulk-modal")).toBeFalsy();
|
|
303
|
-
expect(screen.queryAllByTestId("user-item").length).toBe(
|
|
304
|
-
|
|
305
|
-
expect(store.getActions()).toContainEqual({
|
|
306
|
-
payload: { users: removeUserSiteResponse.data },
|
|
307
|
-
type: "users/SET_USERS",
|
|
308
|
-
});
|
|
302
|
+
expect(screen.queryAllByTestId("user-item").length).toBe(2);
|
|
309
303
|
});
|
|
310
304
|
});
|
|
@@ -352,7 +352,7 @@ const PageItem = (props: IPageItemProps): JSX.Element => {
|
|
|
352
352
|
|
|
353
353
|
if (isAllowedToDelete) {
|
|
354
354
|
menuOptions.push({
|
|
355
|
-
label: isGlobal ? "Remove
|
|
355
|
+
label: isGlobal ? "Remove" : "delete",
|
|
356
356
|
icon: "delete",
|
|
357
357
|
action: isGlobal ? toggleRemoveModal : toggleDeleteModal,
|
|
358
358
|
disabled: deleteDisabled,
|
|
@@ -61,7 +61,7 @@ const UserItem = (props: IUserItemProps): JSX.Element => {
|
|
|
61
61
|
|
|
62
62
|
const deleteOption = isAllowedToRemoveUsers
|
|
63
63
|
? {
|
|
64
|
-
label: isSiteView ? "remove
|
|
64
|
+
label: isSiteView ? "remove" : "delete",
|
|
65
65
|
icon: "delete",
|
|
66
66
|
action: () => toggleModal(),
|
|
67
67
|
disabled: actionIsDisabled,
|