Skip to content

fix: address issues from filters and conditions refactor #1956

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Aug 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
2f20820
addressing requested changes related to tests
abdimo101 Aug 4, 2025
26ff024
addressing rest of the requested changes
abdimo101 Aug 5, 2025
fd183c1
fixed a bug that removes an applied condition when navigating only wh…
abdimo101 Aug 5, 2025
d5b0fef
removed a console log
abdimo101 Aug 5, 2025
77155b3
small cypress change
abdimo101 Aug 6, 2025
f056500
eslint auto format
abdimo101 Aug 6, 2025
2d5275a
removed console logs and unused imports, fixed eslint
abdimo101 Aug 6, 2025
31daf12
Merge branch 'master' into datasets-filter-conditionsV2
abdimo101 Aug 6, 2025
e782c78
eslint fix
abdimo101 Aug 6, 2025
b6d6f71
fixed failing unit test
abdimo101 Aug 6, 2025
c1644c3
fixing cypress tests
abdimo101 Aug 6, 2025
1d0e063
Merge branch 'datasets-filter-conditionsV2' of github.com:SciCatProje…
abdimo101 Aug 6, 2025
bfc4ef9
eslint fix and using concatLatestForm instead of withLatestForm
abdimo101 Aug 6, 2025
8c673af
sourcery changes
abdimo101 Aug 6, 2025
c8e2e6b
Merge branch 'master' into datasets-filter-conditionsV2
abdimo101 Aug 20, 2025
4c366bf
marked the selected row from the list
abdimo101 Aug 21, 2025
994e5a7
showing full text regardless of key length
abdimo101 Aug 21, 2025
0e72fcb
removed some properties as params in createDatasets
abdimo101 Aug 21, 2025
e3b17a4
Merge branch 'master' into datasets-filter-conditionsV2
abdimo101 Aug 22, 2025
953d58c
fixed e2e test
abdimo101 Aug 22, 2025
9d938a1
updated createDatasets cypress command
abdimo101 Aug 22, 2025
b21d0c6
updated e2e tests that uses createDatasets command
abdimo101 Aug 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ jobs:
with:
config-file: cypress.config.ts
install-command: npm install --omit peer

- name: docker logs
if: ${{ failure() }}
run: |
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/datasets/datasets-attachment.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe("Dataset attachments", () => {

describe("Attachment tests", () => {
it("should go to dataset details and add an attachment using the dropzone", () => {
cy.createDataset("raw");
cy.createDataset({ type: "raw" });
cy.visit("/datasets");

cy.get(".dataset-table mat-table mat-header-row").should("exist");
Expand Down
14 changes: 2 additions & 12 deletions cypress/e2e/datasets/datasets-datafiles.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,7 @@ describe("Dataset datafiles", () => {
notebookAll: "http://localhost:4200/notebook/all",
};
it("Should be able to download/notebook with selected/all", () => {
cy.createDataset(
"raw",
testData.rawDataset.datasetName,
undefined,
"small",
);
cy.createDataset({ type: "raw", dataFileSize: "small" });

cy.visit("/datasets");

Expand Down Expand Up @@ -81,12 +76,7 @@ describe("Dataset datafiles", () => {
});

it("Should not be able to download selected/all file that is exceeding size limit", () => {
cy.createDataset(
"raw",
testData.rawDataset.datasetName,
undefined,
"large",
);
cy.createDataset({ type: "raw", dataFileSize: "large" });

cy.visit("/datasets");

Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/datasets/datasets-detail-default.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe("Datasets Detail View Default", () => {
});

cy.login(Cypress.env("username"), Cypress.env("password"));
cy.createDataset("raw");
cy.createDataset({ type: "raw" });
cy.visit("/datasets");
cy.wait("@getFrontendConfig");
});
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/datasets/datasets-detail-dynamic.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe("Datasets Detail View Dynamic", () => {
});

cy.login(Cypress.env("username"), Cypress.env("password"));
cy.createDataset("raw");
cy.createDataset({ type: "raw" });
cy.visit("/datasets");
cy.wait("@getFrontendConfig");
});
Expand Down
89 changes: 35 additions & 54 deletions cypress/e2e/datasets/datasets-general.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe("Datasets general", () => {
cy.login(Cypress.env("username"), Cypress.env("password"));
});

after(() => {
afterEach(() => {
cy.removeDatasets();
});

Expand All @@ -14,7 +14,7 @@ describe("Datasets general", () => {
const username = Cypress.env("username");
const password = Cypress.env("password");

cy.createDataset("raw");
cy.createDataset({ type: "raw" });

cy.visit("/datasets");

Expand Down Expand Up @@ -60,17 +60,17 @@ describe("Datasets general", () => {

cy.get("mat-row").contains("Cypress Dataset").click();
});
afterEach(() => {
cy.removeDatasets();
});
});

describe("Proposal connection and link from dataset details", () => {
it("should be able to see and click proposal connection link from dataset details page", () => {
const proposalId = Math.floor(100000 + Math.random() * 900000).toString();
cy.createProposal({ ...testData.proposal, proposalId });
cy.createDataset("raw", undefined, proposalId);

cy.createDataset({
type: "raw",
dataFileSize: "small",
proposalId,
});
cy.visit("/datasets");

cy.get(".dataset-table mat-table mat-header-row").should("exist");
Expand Down Expand Up @@ -99,25 +99,18 @@ describe("Datasets general", () => {

cy.deleteProposal(proposalId);
});
afterEach(() => {
cy.removeDatasets();
});
});

describe("Dataset page filter and scientific condition UI test", () => {
beforeEach(() => {
cy.createDataset(
"raw",
testData.rawDataset.datasetName,
undefined,
"small",
{
scientificMetadata: {
extra_entry_end_time: { type: "number", value: 2, unit: "" },
},
isPublished: true,
cy.createDataset({
type: "raw",
dataFileSize: "small",
scientificMetadata: {
extra_entry_end_time: { type: "number", value: 2, unit: "" },
},
);
isPublished: true,
});
});

it("should not be able to add duplicated conditions ", () => {
Expand Down Expand Up @@ -214,36 +207,31 @@ describe("Datasets general", () => {
cy.get("mat-slide-toggle").click();

// remove the condition
cy.get("button").contains("Remove").click();
cy.get('[data-cy="remove-condition-button"]').click();

cy.get('[data-cy="scientific-condition-filter-list"]')
.find(".condition-panel")
.should("have.length", 0);
});
afterEach(() => {
cy.removeDatasets();
});
});

describe("Units options in condition panel units dropdown", () => {
beforeEach(() => {
cy.login(Cypress.env("username"), Cypress.env("password"));
cy.createDataset(
"raw",
testData.rawDataset.datasetName,
undefined,
"small",
{
scientificMetadata: {
outgassing_values_after_1h: {
type: "quantity",
value: 2,
unit: "mbar l/s/cm^2",
},
cy.createDataset({
type: "raw",
datasetName: testData.rawDataset.datasetName,
dataFileSize: "small",

scientificMetadata: {
outgassing_values_after_1h: {
type: "quantity",
value: 2,
unit: "mbar l/s/cm^2",
},
isPublished: true,
},
).then(() => {
isPublished: true,
}).then(() => {
cy.readFile("CI/e2e/frontend.config.e2e.json").then((baseConfig) => {
const testConfig = {
...baseConfig,
Expand Down Expand Up @@ -297,7 +285,7 @@ describe("Datasets general", () => {

cy.get(".condition-panel").first().click();

cy.get("button").contains("Remove").click();
cy.get('[data-cy="remove-condition-button"]').click();
});
});

Expand Down Expand Up @@ -334,18 +322,14 @@ describe("Datasets general", () => {
describe("Pre-configured conditions test", () => {
beforeEach(() => {
cy.login(Cypress.env("username"), Cypress.env("password"));
cy.createDataset(
"raw",
testData.rawDataset.datasetName,
undefined,
"small",
{
scientificMetadata: {
extra_entry_end_time: { type: "number", value: 2, unit: "" },
},
isPublished: true,
cy.createDataset({
type: "raw",
dataFileSize: "small",
scientificMetadata: {
extra_entry_end_time: { type: "number", value: 2, unit: "" },
},
).then(() => {
isPublished: true,
}).then(() => {
cy.readFile("CI/e2e/frontend.config.e2e.json").then((baseConfig) => {
const relationsToTest = [
{ relation: "GREATER_THAN", rhs: 1 },
Expand Down Expand Up @@ -406,7 +390,4 @@ describe("Datasets general", () => {
});
});
});
afterEach(() => {
cy.removeDatasets();
});
});
4 changes: 2 additions & 2 deletions cypress/e2e/datasets/datasets-keyword.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe("Datasets", () => {
it("should be able to edit dataset details", () => {
const newName = "Test changing dataset name";
const newDescription = "Test changing dataset description";
cy.createDataset("raw");
cy.createDataset({ type: "raw" });

cy.visit("/datasets");

Expand Down Expand Up @@ -53,7 +53,7 @@ describe("Datasets", () => {
.should("contain.text", newDescription);
});
it("should go to dataset details and add a keyword", () => {
cy.createDataset("raw");
cy.createDataset({ type: "raw" });

cy.visit("/datasets");

Expand Down
34 changes: 25 additions & 9 deletions cypress/e2e/datasets/datasets-metadata.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe("Datasets", () => {

describe("Add metadata item", () => {
it("should go to dataset details and add a metadata entry", () => {
cy.createDataset("raw");
cy.createDataset({ type: "raw" });

cy.visit("/datasets");

Expand Down Expand Up @@ -89,7 +89,7 @@ describe("Datasets", () => {
});

it("should not be able to create a metadata with duplicate name", () => {
cy.createDataset("raw");
cy.createDataset({ type: "raw" });

cy.visit("/datasets");

Expand Down Expand Up @@ -159,7 +159,7 @@ describe("Datasets", () => {
});

it("should not be able to edit the existing metadata with a duplicate name", () => {
cy.createDataset("raw");
cy.createDataset({ type: "raw" });

cy.visit("/datasets");

Expand Down Expand Up @@ -238,7 +238,7 @@ describe("Datasets", () => {
});

it("should show warning icon in the edit and view table if the metadata unit is invalid or cannot be converted", () => {
cy.createDataset("raw");
cy.createDataset({ type: "raw" });

cy.visit("/datasets");

Expand Down Expand Up @@ -333,7 +333,7 @@ describe("Datasets", () => {
});

it("added metadata entry should be visible from the Scientific Metadata(JSON) table", () => {
cy.createDataset("raw");
cy.createDataset({ type: "raw" });

cy.visit("/datasets");

Expand Down Expand Up @@ -410,7 +410,11 @@ describe("Datasets", () => {
human_name: "Date test",
type: "date",
};
cy.createDataset("raw", newMetadataName);
cy.createDataset({
type: "raw",
dataFileSize: "small",
datasetName: newMetadataName,
});

cy.visit("/datasets");

Expand Down Expand Up @@ -488,7 +492,11 @@ describe("Datasets", () => {
human_name: "Link test",
type: "link",
};
cy.createDataset("raw", newMetadataName);
cy.createDataset({
type: "raw",
dataFileSize: "small",
datasetName: newMetadataName,
});

cy.visit("/datasets");

Expand Down Expand Up @@ -566,7 +574,11 @@ describe("Datasets", () => {
human_name: "Number range test",
type: "number_range",
};
cy.createDataset("raw", newMetadataName);
cy.createDataset({
type: "raw",
dataFileSize: "small",
datasetName: newMetadataName,
});

cy.visit("/datasets");

Expand Down Expand Up @@ -647,7 +659,11 @@ describe("Datasets", () => {
valueSI: "0.01,0.02",
unitSI: "m",
};
cy.createDataset("raw", newMetadataName);
cy.createDataset({
type: "raw",
dataFileSize: "small",
datasetName: newMetadataName,
});

cy.visit("/datasets");

Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/datasets/datasets-public.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ describe("Datasets", () => {
beforeEach(() => {
cy.login(Cypress.env("username"), Cypress.env("password"));

cy.createDataset("raw");
cy.createDataset({ type: "raw" });

cy.intercept("PATCH", "/api/v3/datasets/**/*").as("change");
cy.intercept("GET", "*").as("fetch");
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/datasets/datasets-publish.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe("Datasets", () => {

describe("Add item to cart and publish", () => {
it("should add dataset to cart", () => {
cy.createDataset("raw");
cy.createDataset({ type: "raw" });

cy.visit("/datasets");

Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/datasets/datasets-reduce.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe("Datasets", () => {

describe("Reduce dataset", () => {
it("should go to dataset details reduce tab and step through the workflow", () => {
cy.createDataset("raw");
cy.createDataset({ type: "raw" });

cy.visit("/datasets");

Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/datasets/datasets-share.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe("Datasets", () => {

describe("Add item to cart and publish", () => {
it("should add dataset to cart, share it with another user and remove the share", () => {
cy.createDataset("raw");
cy.createDataset({ type: "raw" });

cy.visit("/datasets");

Expand Down
Loading
Loading