Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
delfrrr committed Sep 2, 2024
1 parent 54ea343 commit 3a445f6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/client/lib/ref.test.js
Original file line number Diff line number Diff line change
@@ -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(() => {
Expand All @@ -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')
})
})

0 comments on commit 3a445f6

Please sign in to comment.