Skip to main content
Glama
nrwl

Nx MCP Server

Official
by nrwl
form-update.cy.ts2.21 kB
import { getFieldByName } from '../support/get-elements'; import { visitGenerateUi } from '../support/visit-generate-ui'; describe('Form Value Update', () => { beforeEach(() => { visitGenerateUi({ collectionName: '@nx/test', generatorName: 'test', description: 'description', options: [ { name: 'name', type: 'string', isRequired: false, aliases: [], }, { name: 'directory', type: 'string', isRequired: false, aliases: [], }, ], }); // Wait for the UI to be ready with generator schema cy.get('[data-cy="title"]').should('be.visible'); }); it('should update field values when receiving form-value updates from IDE', () => { getFieldByName('name').should('have.value', ''); getFieldByName('directory').should('have.value', ''); cy.window().then((win) => { (win as any).intellijApi?.postToWebview({ payloadType: 'update-form-values', payload: { name: 'Updated Test Name', directory: 'apps/updated-test-dir', }, }); }); getFieldByName('name').should('have.value', 'Updated Test Name'); getFieldByName('directory').should('have.value', 'apps/updated-test-dir'); }); it('should update CWD breadcrumb when receiving form-value updates from IDE', () => { cy.get('[data-cy="cwd-breadcrumb"]').should('be.visible'); cy.get('[data-cy="inline-edit-button"]').click(); cy.get('[data-cy="inline-edit-field"]').should('have.value', ''); cy.get("[data-cy='inline-edit-confirm']").click(); // Simulate IDE sending cwd update cy.window().then((win) => { (win as any).intellijApi?.postToWebview({ payloadType: 'update-form-values', payload: { cwd: 'apps/my-updated-app', }, }); }); cy.get('[data-cy="cwd-breadcrumb"]').contains('my-updated-app'); // Click edit button and verify value is set in the input field cy.get('[data-cy="inline-edit-button"]').click(); cy.get('[data-cy="inline-edit-field"]').should( 'have.value', 'apps/my-updated-app', ); }); });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nrwl/nx-console'

If you have feedback or need assistance with the MCP directory API, please join our Discord server