logs: add more tests (#70886)

This commit is contained in:
Gábor Farkas 2023-06-29 14:53:31 +02:00 committed by GitHub
parent fc290281cb
commit 890316c105
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,6 +49,34 @@ describe('logParser', () => {
expect(fields.find((field) => field.keys[0] === 'labels')).not.toBe(undefined);
});
it('should not filter out field with labels name and other type and datalinks', () => {
const logRow = createLogRow({
entryFieldIndex: 10,
dataFrame: new MutableDataFrame({
refId: 'A',
fields: [
testStringField,
{
name: 'labels',
type: FieldType.other,
config: {
links: [
{
title: 'test1',
url: 'url1',
},
],
},
values: [{ place: 'luna', source: 'data' }],
},
],
}),
});
const fields = getAllFields(logRow);
expect(fields.length).toBe(2);
expect(fields.find((field) => field.keys[0] === 'labels')).not.toBe(undefined);
});
it('should filter out field with id name', () => {
const logRow = createLogRow({
entryFieldIndex: 10,