From 3a445f676c853b5aa41d681e786c4f97228c63b2 Mon Sep 17 00:00:00 2001 From: Vladi Bilonenko Date: Mon, 2 Sep 2024 13:26:54 +0200 Subject: [PATCH] Fix test --- src/client/lib/ref.test.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/client/lib/ref.test.js b/src/client/lib/ref.test.js index 4069bb3a..b15a0a0f 100644 --- a/src/client/lib/ref.test.js +++ b/src/client/lib/ref.test.js @@ -1,7 +1,7 @@ /* eslint-env jest */ -import { getRef } from './ref' +import { getUrlRef } from './ref' -describe('getRef', () => { +describe('getUrlRef', () => { const v = '1.0.0' let usage, env beforeEach(() => { @@ -23,15 +23,15 @@ describe('getRef', () => { } }) it('localhost', () => { - expect(getRef(env, usage, new URL('http://localhost:3000/reports/7b818764-9f82-4029-99b3-d8faf9ea8de6/source'), v)).toEqual('dekart-1.0.0-localhost-2-1-2-3-4') - expect(getRef(env, usage, new URL('http://localhost/'), v)).toEqual('dekart-1.0.0-localhost-2-1-2-3-4') + expect(getUrlRef(env, usage, new URL('http://localhost:3000/reports/7b818764-9f82-4029-99b3-d8faf9ea8de6/source'), v)).toEqual('dekart-1.0.0-localhost-2-1-2-3-4') + expect(getUrlRef(env, usage, new URL('http://localhost/'), v)).toEqual('dekart-1.0.0-localhost-2-1-2-3-4') }) it('deployment', () => { - expect(getRef(env, usage, new URL('http://play.dekart.xyz/reports/'), v)).toEqual('dekart-1.0.0-3be6a15a-2-1-2-3-4') - expect(getRef(env, usage, new URL('https://play.dekart.xyz/reports/'), v)).toEqual('dekart-1.0.0-3be6a15a-2-1-2-3-4') + expect(getUrlRef(env, usage, new URL('http://play.dekart.xyz/reports/'), v)).toEqual('dekart-1.0.0-3be6a15a-2-1-2-3-4') + expect(getUrlRef(env, usage, new URL('https://play.dekart.xyz/reports/'), v)).toEqual('dekart-1.0.0-3be6a15a-2-1-2-3-4') }) it('stats disabled', () => { env.variables.DISABLE_USAGE_STATS = '1' - expect(getRef(env, usage, new URL('http://play.dekart.xyz/reports/'), v)).toEqual('dekart-stats-disabled') + expect(getUrlRef(env, usage, new URL('http://play.dekart.xyz/reports/'), v)).toEqual('dekart-stats-disabled') }) })