From a497164af27b41db389937736ce56fd9a1917e77 Mon Sep 17 00:00:00 2001 From: Andrew Allen Date: Mon, 24 Jul 2023 15:14:25 -0400 Subject: [PATCH] bump js version to 2.2.0 (#358) --- package.json | 2 +- test/service/poc_mobile.spec.js | 34 +++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 test/service/poc_mobile.spec.js diff --git a/package.json b/package.json index 5414c329..e2b17fd8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@helium/proto", - "version": "2.1.0", + "version": "2.2.0", "description": "Helium protobuf definitions compiled to JS with TypeScript types", "main": "build/index.js", "repository": "git@github.com:helium/proto.git", diff --git a/test/service/poc_mobile.spec.js b/test/service/poc_mobile.spec.js new file mode 100644 index 00000000..7a972995 --- /dev/null +++ b/test/service/poc_mobile.spec.js @@ -0,0 +1,34 @@ +const proto = require('../../build') + +const PocMobile = proto.helium.poc_mobile + +describe('seniority_update', () => { + it('can be constructed', () => { + const now = new Date().getTime() + const txn = PocMobile.seniority_update.create({ + cbsdId: 'some_id', + newSeniorityTimestamp: now, + reason: + PocMobile.seniority_update_reason + .seniority_update_reason_heartbeat_not_seen, + }) + expect(txn.cbsdId).toBe('some_id') + expect(txn.newSeniorityTimestamp).toBe(now) + expect(txn.reason).toBe( + PocMobile.seniority_update_reason + .seniority_update_reason_heartbeat_not_seen, + ) + }) + + it('can be serialized', () => { + const txn = PocMobile.seniority_update.create({ + cbsdId: 'some_id', + newSeniorityTimestamp: 123456789, + reason: + PocMobile.seniority_update_reason + .seniority_update_reason_heartbeat_not_seen, + }) + const serializedTxn = PocMobile.seniority_update.encode(txn).finish() + expect(serializedTxn.toString('base64')).toBe('Cgdzb21lX2lkEJWa7zoYAA==') + }) +})