mirror of
https://github.com/n8n-io/n8n.git
synced 2026-05-12 16:10:30 +02:00
fix(editor): Make agent publish indicator dot use correct color (no-changelog) (#29979)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
ba5b3d13b1
commit
1a270f2f35
|
|
@ -335,4 +335,36 @@ describe('AgentPublishButton', () => {
|
|||
expect(unpublishAgent).not.toHaveBeenCalled();
|
||||
expect(wrapper.emitted('unpublished')).toBeUndefined();
|
||||
});
|
||||
|
||||
// Indicator dot styling — guards against regressions like
|
||||
// using subtle text-color tokens that render an invisible dot.
|
||||
describe('indicator dot', () => {
|
||||
it('does not render the indicator when the agent is not published', async () => {
|
||||
const wrapper = await renderComponent({
|
||||
agent: createAgent({ publishedVersion: null }),
|
||||
});
|
||||
const button = wrapper.find('[data-testid="publish-agent-button"]');
|
||||
expect(button.find('span[class*="indicatorDot"]').exists()).toBe(false);
|
||||
});
|
||||
|
||||
it('renders the published indicator when latest version is published', async () => {
|
||||
const wrapper = await renderComponent({
|
||||
agent: createAgent({ versionId: 'v1', publishedVersion }),
|
||||
});
|
||||
const dot = wrapper.find('[data-testid="publish-agent-button"] span[class*="indicatorDot"]');
|
||||
expect(dot.exists()).toBe(true);
|
||||
expect(dot.classes().some((c) => c.includes('indicatorPublished'))).toBe(true);
|
||||
expect(dot.classes().some((c) => c.includes('indicatorChanges'))).toBe(false);
|
||||
});
|
||||
|
||||
it('renders the changes indicator when there are unpublished changes', async () => {
|
||||
const wrapper = await renderComponent({
|
||||
agent: createAgent({ versionId: 'v2', publishedVersion }),
|
||||
});
|
||||
const dot = wrapper.find('[data-testid="publish-agent-button"] span[class*="indicatorDot"]');
|
||||
expect(dot.exists()).toBe(true);
|
||||
expect(dot.classes().some((c) => c.includes('indicatorChanges'))).toBe(true);
|
||||
expect(dot.classes().some((c) => c.includes('indicatorPublished'))).toBe(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -191,15 +191,15 @@ async function onDropdownSelect(action: string) {
|
|||
}
|
||||
|
||||
.indicatorPublished {
|
||||
background-color: var(--text-color--success);
|
||||
background-color: var(--color--mint-600);
|
||||
}
|
||||
|
||||
.indicatorPublishedText {
|
||||
color: var(--text-color--subtle);
|
||||
color: var(--color--text--tint-1);
|
||||
}
|
||||
|
||||
.indicatorChanges {
|
||||
background-color: var(--text-color--warning);
|
||||
background-color: var(--color--yellow-500);
|
||||
}
|
||||
|
||||
.flex {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user