-
Notifications
You must be signed in to change notification settings - Fork 3k
Added editing option to nodes #502
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
Open
JustinSui624
wants to merge
45
commits into
AykutSarac:main
Choose a base branch
from
JustinSui624:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
fa79b34
Update useFile.ts
ramfam101 d427aaa
fix
JeevanRMunn dc60cb1
newt
JeevanRMunn b4fa96b
testing
JeevanRMunn 755112d
Merge pull request #2 from ramfam101/testbr
ramfam101 28ebd82
small changes
ramfam101 97b0c85
updates
ramfam101 71b6b74
update
ramfam101 9a94676
Update node_modal_edit_button.cy.js
ramfam101 fda2be5
first try
b6587aa
second try
499f592
third try
de893c0
small change to check
dd49a47
4th try
f393c15
5th try
7c0dc68
6th try
5935732
7th try
9bda158
8th try
559c50e
9th try
d8323b5
debugging
f2db159
undo errors
19106a9
debugging
7e3b870
trial and error
1651879
again
04960f2
again
e58a2fd
again
10cad0a
again
5913e94
again
8c660e8
again
0c83e09
brick by brick
c51f14b
i stg
ce76203
...
d4adb12
ok
e397610
.
91ea5d9
.
9d82f67
.
5c9f39e
.
8d340e0
.
2d760e6
plz
1280e78
.
edc6702
.
b966235
Done!
b599725
more changes
90d9e55
Now Done!
f0182f3
ok now done
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| import { defineConfig } from "cypress"; | ||
|
|
||
| export default defineConfig({ | ||
| component: { | ||
| devServer: { | ||
| framework: "next", | ||
| bundler: "webpack", | ||
| }, | ||
| }, | ||
|
|
||
| e2e: { | ||
| setupNodeEvents(on, config) { | ||
| // implement node event listeners here | ||
| }, | ||
| }, | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| describe('NodeModal Edit Button Visibility', () => { | ||
| let editCount = 0; | ||
| let saveCount = 0; | ||
| let cancelCount = 0; | ||
|
|
||
| beforeEach(() => { | ||
| cy.visit('http://localhost:3000/editor'); | ||
| }); | ||
|
|
||
| it('finds nodes with editable modals and counts Edit, Save, Cancel buttons', () => { | ||
| cy.get('g[id^="ref-"][id*="node"] rect', { timeout: 5000 }).each(($rect, index, $list) => { | ||
| cy.wrap($rect).click(); | ||
|
|
||
| cy.get('.mantine-Modal-root').should('be.visible'); | ||
| cy.contains('Content').should('exist'); | ||
|
|
||
| cy.get('body').then($body => { | ||
| const editButton = $body.find('button:contains("Edit")'); | ||
| if (editButton.length > 0) { | ||
| editCount++; | ||
| cy.contains('button', 'Edit').click(); | ||
| cy.contains('button', 'Save').should('exist'); | ||
| cy.contains('button', 'Cancel').should('exist'); | ||
| saveCount++; | ||
| cancelCount++; | ||
|
|
||
| cy.contains('button', 'Cancel').click(); | ||
| cy.get('.m_b5489c3c > .mantine-focus-auto').click(); | ||
| return false; // Stop after first editable node | ||
| } else { | ||
| cy.get('.m_b5489c3c > .mantine-focus-auto').click(); | ||
| } | ||
|
Comment on lines
+27
to
+32
|
||
| }); | ||
| }).then(() => { | ||
| cy.log(`✅ Found Edit buttons: ${editCount}`); | ||
| cy.log(`✅ Found Save buttons: ${saveCount}`); | ||
| cy.log(`✅ Found Cancel buttons: ${cancelCount}`); | ||
| console.log(`Edit: ${editCount}, Save: ${saveCount}, Cancel: ${cancelCount}`); | ||
| }); | ||
| }); | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "name": "Using fixtures to represent data", | ||
| "email": "[email protected]", | ||
| "body": "Fixtures are a great way to mock data for responses to routes" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| /// <reference types="cypress" /> | ||
| // *********************************************** | ||
| // This example commands.ts shows you how to | ||
| // create various custom commands and overwrite | ||
| // existing commands. | ||
| // | ||
| // For more comprehensive examples of custom | ||
| // commands please read more here: | ||
| // https://on.cypress.io/custom-commands | ||
| // *********************************************** | ||
| // | ||
| // | ||
| // -- This is a parent command -- | ||
| // Cypress.Commands.add('login', (email, password) => { ... }) | ||
| // | ||
| // | ||
| // -- This is a child command -- | ||
| // Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... }) | ||
| // | ||
| // | ||
| // -- This is a dual command -- | ||
| // Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... }) | ||
| // | ||
| // | ||
| // -- This will overwrite an existing command -- | ||
| // Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) | ||
| // | ||
| // declare global { | ||
| // namespace Cypress { | ||
| // interface Chainable { | ||
| // login(email: string, password: string): Chainable<void> | ||
| // drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element> | ||
| // dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element> | ||
| // visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element> | ||
| // } | ||
| // } | ||
| // } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| <!DOCTYPE html> | ||
| <html> | ||
| <head> | ||
| <meta charset="utf-8"> | ||
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
| <meta name="viewport" content="width=device-width,initial-scale=1.0"> | ||
| <title>Components App</title> | ||
| <!-- Used by Next.js to inject CSS. --> | ||
| <div id="__next_css__DO_NOT_USE__"></div> | ||
| </head> | ||
| <body> | ||
| <div data-cy-root></div> | ||
| </body> | ||
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| // *********************************************************** | ||
| // This example support/component.ts is processed and | ||
| // loaded automatically before your test files. | ||
| // | ||
| // This is a great place to put global configuration and | ||
| // behavior that modifies Cypress. | ||
| // | ||
| // You can change the location of this file or turn off | ||
| // automatically serving support files with the | ||
| // 'supportFile' configuration option. | ||
| // | ||
| // You can read more here: | ||
| // https://on.cypress.io/configuration | ||
| // *********************************************************** | ||
|
|
||
| // Import commands.js using ES2015 syntax: | ||
| import './commands' | ||
|
|
||
| import { mount } from 'cypress/react' | ||
|
|
||
| // Augment the Cypress namespace to include type definitions for | ||
| // your custom command. | ||
| // Alternatively, can be defined in cypress/support/component.d.ts | ||
| // with a <reference path="./component" /> at the top of your spec. | ||
| declare global { | ||
| namespace Cypress { | ||
| interface Chainable { | ||
| mount: typeof mount | ||
| } | ||
| } | ||
| } | ||
|
|
||
| Cypress.Commands.add('mount', mount) | ||
|
|
||
| // Example use: | ||
| // cy.mount(<MyComponent />) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| // *********************************************************** | ||
| // This example support/e2e.ts is processed and | ||
| // loaded automatically before your test files. | ||
| // | ||
| // This is a great place to put global configuration and | ||
| // behavior that modifies Cypress. | ||
| // | ||
| // You can change the location of this file or turn off | ||
| // automatically serving support files with the | ||
| // 'supportFile' configuration option. | ||
| // | ||
| // You can read more here: | ||
| // https://on.cypress.io/configuration | ||
| // *********************************************************** | ||
|
|
||
| // Import commands.js using ES2015 syntax: | ||
| import './commands' |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Selector relies on internal SVG id patterns and is brittle. Prefer the explicit test hook added in code (e.g., [data-testid='open-node-modal']) to make the test stable and intention-revealing.