Skip to content

Commit

Permalink
Merge pull request #294 from NucleoidAI/query-improvement
Browse files Browse the repository at this point in the history
Query Improvement
  • Loading branch information
canmingir authored Jun 18, 2024
2 parents 63f41e0 + 141faad commit 8dbab69
Show file tree
Hide file tree
Showing 34 changed files with 719 additions and 570 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
/.pnp
.pnp.js

/cypress/videos/*

# testing
/coverage

Expand Down
1 change: 1 addition & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import appConfig from "./config.js";
import { defineConfig } from "cypress";

const config = defineConfig({
defaultCommandTimeout: 60000,
component: {
devServer: {
framework: "react",
Expand Down
21 changes: 0 additions & 21 deletions cypress/components/APITree.cy.jsx

This file was deleted.

274 changes: 0 additions & 274 deletions cypress/components/APITypes.cy.jsx

This file was deleted.

51 changes: 51 additions & 0 deletions cypress/e2e/api/api.spec.cy.js → cypress/e2e/API/API.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,55 @@ describe("API Page", () => {
}
});
});

describe("Local Mode", () => {
beforeEach(() => {
cy.setup("IDE", "SEED", "LOCAL");
cy.fixture("PROJECTS/LOCAL/project.json").as("project");
cy.wrap("3450f289-0fc5-45e9-9a4a-606c0a63cdfe").as("projectId");
});

it("saves changes in API editor", function () {
cy.visit(`/${this.projectId}/api?mode=local`);

cy.waitEvent("CONTAINER_LOADED");

const changedEditorValue = `function action(req: { params: { item: string } }): any {\n const newItem = req.params.item;\n return Item[newItem];\n}`;

cy.typeEditor(changedEditorValue);

cy.checkLocalContext(this.projectId, "api", changedEditorValue);
});
});

describe("Cloud Mode", () => {
beforeEach(() => {
cy.setup("IDE", "SEED", "CLOUD");

cy.wrap("a166cc16-5c76-4aac-819e-118207a5dfa9").as("projectId");
cy.wrap("06843e12-bc10-4648-99dc-85ad4be1cd09").as("serviceId");

cy.get("@serviceId").then((serviceId) => {
cy.saveContextIntercept(serviceId).as("saveContext");
});
});

it("saves changes in API editor", () => {
cy.get("@projectId").then((projectId) => {
cy.visit(`/${projectId}/api`);
});

cy.waitEvent("CONTAINER_LOADED");

const changedEditorValue = `function action(req: { params: { item: string } }): any {\n const newItem = req.params.item;\n return Item[newItem];\n`;

cy.typeEditor(changedEditorValue);

cy.reload().then(() => {
cy.waitEvent("CONTAINER_LOADED");

cy.checkEditorValue(changedEditorValue);
});
});
});
});
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 8dbab69

Please sign in to comment.