The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
grafana/devenv/e2e-api-tests/user.test.ts

23 lines
681 B

import client from './client';
import * as setup from './setup';
describe('GET /api/user', () => {
it('should return current authed user', async () => {
let rsp = await client.get('/api/user');
expect(rsp.data.login).toBe('admin');
});
});
describe('PUT /api/user', () => {
it('should update current authed user', async () => {
const user = await setup.getUser(setup.editor);
user.name = 'Updated via test';
const rsp = await client.callAs(user).put('/api/user', user);
expect(rsp.data.message).toBe('User updated');
const updated = await client.callAs(user).get('/api/user');
expect(updated.data.name).toBe('Updated via test');
});
});