projects
/
arvados-workbench2.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add adding files to upload zone
[arvados-workbench2.git]
/
src
/
store
/
project
/
project-reducer.test.ts
diff --git
a/src/store/project/project-reducer.test.ts
b/src/store/project/project-reducer.test.ts
index 970af6ca968b992b401157da8fc9d5e1c3e24f82..92274b3d281efba4886f8aff65687e4d6625e426 100644
(file)
--- a/
src/store/project/project-reducer.test.ts
+++ b/
src/store/project/project-reducer.test.ts
@@
-2,13
+2,10
@@
//
// SPDX-License-Identifier: AGPL-3.0
//
// SPDX-License-Identifier: AGPL-3.0
-import
projectsReducer, {
getTreePath } from "./project-reducer";
-import
actions
from "./project-action";
+import
{ projectsReducer,
getTreePath } from "./project-reducer";
+import
{ projectActions }
from "./project-action";
import { TreeItem, TreeItemStatus } from "../../components/tree/tree";
import { TreeItem, TreeItemStatus } from "../../components/tree/tree";
-import { ResourceKind } from "../../models/kinds";
import { mockProjectResource } from "../../models/test-utils";
import { mockProjectResource } from "../../models/test-utils";
-import { ProjectResource } from "../../models/project";
-import { GroupClass } from "../../models/group";
describe('project-reducer', () => {
describe('project-reducer', () => {
@@
-16,7
+13,7
@@
describe('project-reducer', () => {
const initialState = undefined;
const projects = [mockProjectResource({ uuid: "1" }), mockProjectResource({ uuid: "2" })];
const initialState = undefined;
const projects = [mockProjectResource({ uuid: "1" }), mockProjectResource({ uuid: "2" })];
- const state = projectsReducer(initialState,
a
ctions.PROJECTS_SUCCESS({ projects, parentItemId: undefined }));
+ const state = projectsReducer(initialState,
projectA
ctions.PROJECTS_SUCCESS({ projects, parentItemId: undefined }));
expect(state).toEqual({
items: [{
active: false,
expect(state).toEqual({
items: [{
active: false,
@@
-31,14
+28,13
@@
describe('project-reducer', () => {
id: "2",
items: [],
data: mockProjectResource({ uuid: "2" }),
id: "2",
items: [],
data: mockProjectResource({ uuid: "2" }),
- status:
0
+ status:
TreeItemStatus.INITIAL
}
],
currentItemId: "",
creator: {
opened: false,
ownerUuid: "",
}
],
currentItemId: "",
creator: {
opened: false,
ownerUuid: "",
- pending: false
}
});
});
}
});
});
@@
-50,10
+46,10
@@
describe('project-reducer', () => {
id: "1",
open: true,
active: true,
id: "1",
open: true,
active: true,
- status:
1
+ status:
TreeItemStatus.PENDING
}],
currentItemId: "1",
}],
currentItemId: "1",
- creator: { opened: false,
pending: false,
ownerUuid: "" },
+ creator: { opened: false, ownerUuid: "" },
};
const project = {
items: [{
};
const project = {
items: [{
@@
-61,13
+57,13
@@
describe('project-reducer', () => {
id: "1",
open: true,
active: false,
id: "1",
open: true,
active: false,
- status:
1
+ status:
TreeItemStatus.PENDING
}],
currentItemId: "",
}],
currentItemId: "",
- creator: { opened: false,
pending: false,
ownerUuid: "" },
+ creator: { opened: false, ownerUuid: "" },
};
};
- const state = projectsReducer(initialState,
a
ctions.RESET_PROJECT_TREE_ACTIVITY(initialState.items[0].id));
+ const state = projectsReducer(initialState,
projectA
ctions.RESET_PROJECT_TREE_ACTIVITY(initialState.items[0].id));
expect(state).toEqual(project);
});
expect(state).toEqual(project);
});
@@
-78,10
+74,10
@@
describe('project-reducer', () => {
id: "1",
open: true,
active: false,
id: "1",
open: true,
active: false,
- status:
1
+ status:
TreeItemStatus.PENDING
}],
currentItemId: "1",
}],
currentItemId: "1",
- creator: { opened: false,
pending: false,
ownerUuid: "" }
+ creator: { opened: false, ownerUuid: "" }
};
const project = {
items: [{
};
const project = {
items: [{
@@
-89,14
+85,13
@@
describe('project-reducer', () => {
id: "1",
open: true,
active: true,
id: "1",
open: true,
active: true,
- status: 1,
- toggled: true
+ status: TreeItemStatus.PENDING,
}],
currentItemId: "1",
}],
currentItemId: "1",
- creator: { opened: false,
pending: false,
ownerUuid: "" },
+ creator: { opened: false, ownerUuid: "" },
};
};
- const state = projectsReducer(initialState,
a
ctions.TOGGLE_PROJECT_TREE_ITEM_ACTIVE(initialState.items[0].id));
+ const state = projectsReducer(initialState,
projectA
ctions.TOGGLE_PROJECT_TREE_ITEM_ACTIVE(initialState.items[0].id));
expect(state).toEqual(project);
});
expect(state).toEqual(project);
});
@@
-108,11
+103,10
@@
describe('project-reducer', () => {
id: "1",
open: true,
active: false,
id: "1",
open: true,
active: false,
- status: 1,
- toggled: false,
+ status: TreeItemStatus.PENDING,
}],
currentItemId: "1",
}],
currentItemId: "1",
- creator: { opened: false,
pending: false,
ownerUuid: "" }
+ creator: { opened: false, ownerUuid: "" }
};
const project = {
items: [{
};
const project = {
items: [{
@@
-120,14
+114,13
@@
describe('project-reducer', () => {
id: "1",
open: false,
active: false,
id: "1",
open: false,
active: false,
- status: 1,
- toggled: true
+ status: TreeItemStatus.PENDING,
}],
currentItemId: "1",
}],
currentItemId: "1",
- creator: { opened: false,
pending: false,
ownerUuid: "" },
+ creator: { opened: false, ownerUuid: "" },
};
};
- const state = projectsReducer(initialState,
a
ctions.TOGGLE_PROJECT_TREE_ITEM_OPEN(initialState.items[0].id));
+ const state = projectsReducer(initialState,
projectA
ctions.TOGGLE_PROJECT_TREE_ITEM_OPEN(initialState.items[0].id));
expect(state).toEqual(project);
});
});
expect(state).toEqual(project);
});
});
@@
-139,7
+132,7
@@
describe("findTreeBranch", () => {
active: false,
data: "",
open: false,
active: false,
data: "",
open: false,
- status: TreeItemStatus.I
nitial
+ status: TreeItemStatus.I
NITIAL
});
it("should return an array that matches path to the given item", () => {
});
it("should return an array that matches path to the given item", () => {