test: add test case for telemetryId gif route
This commit is contained in:
parent
720a1d744e
commit
b0bf0aa0ef
@ -5,6 +5,30 @@ import { generateETag } from '../../utils/common';
|
|||||||
describe('telemetry router', () => {
|
describe('telemetry router', () => {
|
||||||
const { app, createTestUser, createTestTelemetry } = createTestContext();
|
const { app, createTestUser, createTestTelemetry } = createTestContext();
|
||||||
|
|
||||||
|
describe('/:telemetryId.gif', () => {
|
||||||
|
test('normal', async () => {
|
||||||
|
const { workspace } = await createTestUser();
|
||||||
|
const telemetry = await createTestTelemetry(workspace.id);
|
||||||
|
|
||||||
|
const { status } = await app.get(
|
||||||
|
`/telemetry/${workspace.id}/${telemetry.id}.svg`
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(status).toBe(200);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('with query', async () => {
|
||||||
|
const { workspace } = await createTestUser();
|
||||||
|
const telemetry = await createTestTelemetry(workspace.id);
|
||||||
|
|
||||||
|
const { status } = await app.get(
|
||||||
|
`/telemetry/${workspace.id}/${telemetry.id}.svg?name=tianji-oss&url=http://localhost:10000&v=1.8.2`
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(status).toBe(200);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('/badge', () => {
|
describe('/badge', () => {
|
||||||
test('check header', async () => {
|
test('check header', async () => {
|
||||||
const { workspace } = await createTestUser();
|
const { workspace } = await createTestUser();
|
||||||
|
Loading…
Reference in New Issue
Block a user