Skip to content

Commit

Permalink
feat: Rename cell to protein and gene to sample.
Browse files Browse the repository at this point in the history
  • Loading branch information
NetoRutes committed Dec 11, 2024
1 parent fd8b47b commit 6faf441
Show file tree
Hide file tree
Showing 56 changed files with 648 additions and 634 deletions.
1 change: 1 addition & 0 deletions client/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
index_template.html
2 changes: 1 addition & 1 deletion client/__tests__/e2e/cellxgeneActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ export async function assertGenesetExists(genesetName) {

/*
GENE
SAMPLE
*/

Expand Down
94 changes: 47 additions & 47 deletions client/__tests__/reducers/genesets.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ describe("initial reducer state", () => {
});
});

describe("geneset: initial load", () => {
describe("sampleset: initial load", () => {
test("missing JSON response", () => {
expect(() =>
genesetsReducer(undefined, {
type: "geneset: initial load",
type: "sampleset: initial load",
})
).toThrow("missing or malformed JSON response");
});

test("empty geneset", () => {
expect(
genesetsReducer(undefined, {
type: "geneset: initial load",
type: "sampleset: initial load",
data: {
tid: 0,
genesets: [],
Expand All @@ -38,7 +38,7 @@ describe("geneset: initial load", () => {
test("non-empty geneset", () => {
expect(
genesetsReducer(undefined, {
type: "geneset: initial load",
type: "sampleset: initial load",
data: {
tid: 99,
genesets: [
Expand Down Expand Up @@ -94,9 +94,9 @@ describe("geneset: initial load", () => {
});
});

describe("geneset: create", () => {
describe("sampleset: create", () => {
const initialState = genesetsReducer(undefined, {
type: "geneset: initial load",
type: "sampleset: initial load",
data: {
tid: 0,
genesets: [],
Expand All @@ -106,7 +106,7 @@ describe("geneset: create", () => {
test("simple create", () => {
expect(
genesetsReducer(initialState, {
type: "geneset: create",
type: "sampleset: create",
genesetName: "a geneset",
genesetDescription: "",
})
Expand All @@ -129,12 +129,12 @@ describe("geneset: create", () => {
expect(() => {
genesetsReducer(
genesetsReducer(initialState, {
type: "geneset: create",
type: "sampleset: create",
genesetName: "foo",
genesetDescription: "foo",
}),
{
type: "geneset: create",
type: "sampleset: create",
genesetName: "foo",
genesetDescription: "bar",
}
Expand All @@ -145,22 +145,22 @@ describe("geneset: create", () => {
test("error - missing required action values", () => {
expect(() => {
genesetsReducer(initialState, {
type: "geneset: create",
type: "sampleset: create",
genesetDescription: "foo",
});
}).toThrow();
expect(() => {
genesetsReducer(initialState, {
type: "geneset: create",
type: "sampleset: create",
genesetName: "foo",
});
}).toThrow("name or description unspecified");
});
});

describe("geneset: delete", () => {
describe("sampleset: delete", () => {
const initialState = genesetsReducer(undefined, {
type: "geneset: initial load",
type: "sampleset: initial load",
data: {
tid: 0,
genesets: [],
Expand All @@ -171,12 +171,12 @@ describe("geneset: delete", () => {
expect(
genesetsReducer(
genesetsReducer(initialState, {
type: "geneset: create",
type: "sampleset: create",
genesetName: "foo",
genesetDescription: "foo",
}),
{
type: "geneset: delete",
type: "sampleset: delete",
genesetName: "foo",
}
)
Expand All @@ -190,16 +190,16 @@ describe("geneset: delete", () => {
test("error - missing name", () => {
expect(() => {
genesetsReducer(initialState, {
type: "geneset: delete",
type: "sampleset: delete",
genesetName: "foo",
});
}).toThrow("name does not exist");
});
});

describe("geneset: update", () => {
describe("sampleset: update", () => {
const initialState = genesetsReducer(undefined, {
type: "geneset: initial load",
type: "sampleset: initial load",
data: {
tid: 0,
genesets: [],
Expand All @@ -211,18 +211,18 @@ describe("geneset: update", () => {
genesetsReducer(
genesetsReducer(
genesetsReducer(initialState, {
type: "geneset: create",
type: "sampleset: create",
genesetName: "foo1",
genesetDescription: "foo1",
}),
{
type: "geneset: create",
type: "sampleset: create",
genesetName: "foo2",
genesetDescription: "foo2",
}
),
{
type: "geneset: update",
type: "sampleset: update",
genesetName: "foo1",
update: {
genesetName: "bar",
Expand All @@ -249,7 +249,7 @@ describe("geneset: update", () => {
test("error - unknown name", () => {
expect(() => {
genesetsReducer(initialState, {
type: "geneset: update",
type: "sampleset: update",
genesetName: "foo",
update: {
genesetName: "foo",
Expand All @@ -263,12 +263,12 @@ describe("geneset: update", () => {
expect(() => {
genesetsReducer(
genesetsReducer(initialState, {
type: "geneset: create",
type: "sampleset: create",
genesetName: "foo",
genesetDescription: "foo",
}),
{
type: "geneset: update",
type: "sampleset: update",
genesetName: "foo",
update: {
genesetName: "foo",
Expand All @@ -280,17 +280,17 @@ describe("geneset: update", () => {
});
});

describe("geneset: add genes", () => {
describe("sampleset: add samples", () => {
const initialState = genesetsReducer(
genesetsReducer(undefined, {
type: "geneset: initial load",
type: "sampleset: initial load",
data: {
tid: 0,
genesets: [],
},
}),
{
type: "geneset: create",
type: "sampleset: create",
genesetName: "test",
genesetDescription: "",
}
Expand All @@ -299,7 +299,7 @@ describe("geneset: add genes", () => {
test("add a gene", () => {
expect(
genesetsReducer(initialState, {
type: "geneset: add genes",
type: "sampleset: add samples",
genesetName: "test",
genes: [{ geneSymbol: "F5" }],
})
Expand All @@ -319,7 +319,7 @@ describe("geneset: add genes", () => {

expect(
genesetsReducer(initialState, {
type: "geneset: add genes",
type: "sampleset: add samples",
genesetName: "test",
genes: [
{ geneSymbol: "F5", geneDescription: "desc" },
Expand Down Expand Up @@ -347,32 +347,32 @@ describe("geneset: add genes", () => {
test("no such geneset error", () => {
expect(() => {
genesetsReducer(initialState, {
type: "geneset: add genes",
type: "sampleset: add samples",
genesetName: "mumble",
genes: [],
});
}).toThrow("geneset name does not exist");
});
});

describe("geneset: delete genes", () => {
describe("sampleset: delete samples", () => {
const initialState = genesetsReducer(
genesetsReducer(
genesetsReducer(undefined, {
type: "geneset: initial load",
type: "sampleset: initial load",
data: {
tid: 0,
genesets: [],
},
}),
{
type: "geneset: create",
type: "sampleset: create",
genesetName: "test",
genesetDescription: "",
}
),
{
type: "geneset: add genes",
type: "sampleset: add samples",
genesetName: "test",
genes: [{ geneSymbol: "F5" }],
}
Expand All @@ -381,7 +381,7 @@ describe("geneset: delete genes", () => {
test("simple", () => {
expect(
genesetsReducer(initialState, {
type: "geneset: delete genes",
type: "sampleset: delete samples",
genesetName: "test",
geneSymbols: ["F5"],
})
Expand All @@ -403,32 +403,32 @@ describe("geneset: delete genes", () => {
test("no such geneset error", () => {
expect(() => {
genesetsReducer(initialState, {
type: "geneset: delete genes",
type: "sampleset: delete samples",
genesetName: "mumble",
geneSymbols: [],
});
}).toThrow("name does not exist");
});
});

describe("geneset: set gene description", () => {
describe("sampleset: set sample description", () => {
const initialState = genesetsReducer(
genesetsReducer(
genesetsReducer(undefined, {
type: "geneset: initial load",
type: "sampleset: initial load",
data: {
tid: 0,
genesets: [],
},
}),
{
type: "geneset: create",
type: "sampleset: create",
genesetName: "test",
genesetDescription: "",
}
),
{
type: "geneset: add genes",
type: "sampleset: add samples",
genesetName: "test",
genes: [{ geneSymbol: "F5" }],
}
Expand All @@ -437,7 +437,7 @@ describe("geneset: set gene description", () => {
test("simple set", () => {
expect(
genesetsReducer(initialState, {
type: "geneset: set gene description",
type: "sampleset: set sample description",
genesetName: "test",
update: {
geneSymbol: "F5",
Expand All @@ -464,7 +464,7 @@ describe("geneset: set gene description", () => {
test("no such geneset error", () => {
expect(() => {
genesetsReducer(initialState, {
type: "geneset: set gene description",
type: "sampleset: set sample description",
genesetName: "does not exist",
update: {
geneSymbol: "F5",
Expand All @@ -477,7 +477,7 @@ describe("geneset: set gene description", () => {
test("no such gene error", () => {
expect(() => {
genesetsReducer(initialState, {
type: "geneset: set gene description",
type: "sampleset: set sample description",
genesetName: "test",
update: {
geneSymbol: "NO SUCH GENE",
Expand All @@ -488,11 +488,11 @@ describe("geneset: set gene description", () => {
});
});

describe("geneset: set tid", () => {
describe("sampleset: set tid", () => {
test("simple set", () => {
expect(
genesetsReducer(undefined, {
type: "geneset: set tid",
type: "sampleset: set tid",
tid: 1,
})
).toMatchObject({ lastTid: 1 });
Expand All @@ -503,7 +503,7 @@ describe("geneset: set tid", () => {
genesetsReducer(
{ lastTid: 1 },
{
type: "geneset: set tid",
type: "sampleset: set tid",
tid: "0",
}
);
Expand All @@ -515,7 +515,7 @@ describe("geneset: set tid", () => {
genesetsReducer(
{ lastTid: 1 },
{
type: "geneset: set tid",
type: "sampleset: set tid",
tid: 0,
}
);
Expand Down
Loading

0 comments on commit 6faf441

Please sign in to comment.