From 9d28e6978043cdc4d9d647089e972d99a33311b3 Mon Sep 17 00:00:00 2001 From: Jakub Bednar Date: Mon, 18 Sep 2023 13:33:53 +0200 Subject: [PATCH] chore: test point values --- packages/client/test/unit/util/point.test.ts | 23 ++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/packages/client/test/unit/util/point.test.ts b/packages/client/test/unit/util/point.test.ts index ececa45d..c4e1b165 100644 --- a/packages/client/test/unit/util/point.test.ts +++ b/packages/client/test/unit/util/point.test.ts @@ -238,5 +238,28 @@ describe('point', () => { v.removeField('b') expect(false).equals(v.hasFields()) }) + it('remove tag', () => { + const v = new PointValues() + .setMeasurement('a') + .setField('b', 1) + .setTag('c', 'd') + .setTimestamp(150) + expect(true).eq(v.getTagNames().includes('c')) + v.removeTag('c') + expect(false).eq(v.getTagNames().includes('c')) + }) + it('field values', () => { + const v = new PointValues() + .setMeasurement('a') + .setIntegerField('b', 1) + .setField('c', 'xyz') + .setField('d', false) + .setField('e', 3.45) + .setTimestamp(150) + expect(1).deep.equals(v.getIntegerField('b')) + expect('xyz').deep.equals(v.getStringField('c')) + expect(false).deep.equals(v.getBooleanField('d')) + expect(3.45).deep.equals(v.getFloatField('e')) + }) }) })