feat(editor): Add RAG starter template callouts experiment (#16282)

Co-authored-by: Charlie Kolb <charlie@n8n.io>
This commit is contained in:
Jaakko Husso
2025-06-13 17:45:30 +03:00
committed by GitHub
parent 30148df7f3
commit d0a313aa1c
27 changed files with 1032 additions and 24 deletions

View File

@@ -83,9 +83,10 @@ describe('ParameterInputList', () => {
});
// Should render labels for all parameters
TEST_PARAMETERS.forEach((parameter) => {
FIXED_COLLECTION_PARAMETERS.forEach((parameter) => {
expect(getByText(parameter.displayName)).toBeInTheDocument();
});
// Should render input placeholders for all fixed collection parameters
expect(getAllByTestId('suspense-stub')).toHaveLength(FIXED_COLLECTION_PARAMETERS.length);
});
@@ -100,7 +101,7 @@ describe('ParameterInputList', () => {
});
// Should render labels for all parameters
TEST_PARAMETERS.forEach((parameter) => {
FIXED_COLLECTION_PARAMETERS.forEach((parameter) => {
expect(getByText(parameter.displayName)).toBeInTheDocument();
});
// Should render error message for fixed collection parameter
@@ -110,6 +111,35 @@ describe('ParameterInputList', () => {
expect(getByText(TEST_ISSUE)).toBeInTheDocument();
});
it('renders notice correctly', () => {
ndvStore.activeNode = TEST_NODE_NO_ISSUES;
const { getByText } = renderComponent({
props: {
parameters: TEST_PARAMETERS,
nodeValues: TEST_NODE_VALUES,
},
});
expect(getByText('Note: This is a notice with')).toBeInTheDocument();
expect(getByText('notice link')).toBeInTheDocument();
expect(getByText('notice link').getAttribute('href')).toEqual('notice.n8n.io');
});
it('renders callout correctly', () => {
ndvStore.activeNode = TEST_NODE_NO_ISSUES;
const { getByTestId, getByText } = renderComponent({
props: {
parameters: TEST_PARAMETERS,
nodeValues: TEST_NODE_VALUES,
},
});
expect(getByText('Tip: This is a callout with')).toBeInTheDocument();
expect(getByText('callout link')).toBeInTheDocument();
expect(getByText('callout link').getAttribute('href')).toEqual('callout.n8n.io');
expect(getByText('and action!')).toBeInTheDocument();
expect(getByTestId('callout-dismiss-icon')).toBeInTheDocument();
});
describe('updateFormParameters', () => {
const workflowHelpersMock: MockInstance = vi.spyOn(workflowHelpers, 'useWorkflowHelpers');
const formParameters = [