n8n/packages/testing/playwright/utils/url-helper.test.ts
n8n-cat-bot[bot] ec267acdbc
test: Wait for backend readiness before the Playwright database reset (#38366)
Co-authored-by: n8n-cat-bot[bot] <n8n-cat-bot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Declan Carroll <declan@n8n.io>
2026-09-10 16:48:50 +00:00

30 lines
841 B
TypeScript

import { describe, expect, test } from 'vitest';
import { getReadinessUrl } from './url-helper';
describe('getReadinessUrl', () => {
test('uses the default health endpoint', () => {
expect(getReadinessUrl('http://localhost:5678')).toBe(
'http://localhost:5678/healthz/readiness',
);
});
test('uses a custom health endpoint', () => {
expect(getReadinessUrl('http://localhost:5678', '/health')).toBe(
'http://localhost:5678/health/readiness',
);
});
test('adds the leading slash a custom health endpoint may omit', () => {
expect(getReadinessUrl('http://localhost:5678', 'health')).toBe(
'http://localhost:5678/health/readiness',
);
});
test('drops a trailing slash of the base URL', () => {
expect(getReadinessUrl('http://localhost:5678/')).toBe(
'http://localhost:5678/healthz/readiness',
);
});
});