mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-14 04:06:45 +00:00

* Releases updated version of datahub-web client UI code * Fix typo in yarn lock * Change yarn lock to match yarn registry directories * Previous commit missed some paths * Even more changes to yarnlock missing in previous commit * Include codegen file for typings * Add files to get parity for datahub-web and current OS datahub-midtier * Add in typo fix from previous commit - change to proper license * Implement proper OS fix for person entity picture url * Workarounds for open source DH issues * Fixes institutional memory api and removes unopensourced tabs for datasets * Fixes search dataset deprecation and user search issue as a result of changes * Remove internal only options in the avatar menu
22 lines
845 B
TypeScript
22 lines
845 B
TypeScript
import { module, test } from 'qunit';
|
|
import { encodeDot, decodeDot } from '@datahub/utils/validators/encode';
|
|
|
|
module('Unit | Utility | validators/json', function() {
|
|
test('encodeDot and decodeDot works as expected', function(assert): void {
|
|
const testCaseA = 'pikachu.thunder';
|
|
const testCaseB = 'pik.chu.thund.er';
|
|
|
|
const resultA = encodeDot(testCaseA);
|
|
const resultB = encodeDot(testCaseB);
|
|
|
|
assert.equal(resultA, 'pikachu%2Ethunder', 'Works for a single use case');
|
|
assert.equal(resultB, 'pik%2Echu%2Ethund%2Eer', 'Works for multidot use case');
|
|
|
|
const resultC = decodeDot(resultA);
|
|
const resultD = decodeDot(resultB);
|
|
|
|
assert.equal(resultC, testCaseA, 'decodeDot reverses encodeDot in single use case');
|
|
assert.equal(resultD, testCaseB, 'decodeDot reverses encodeDot in multidot case');
|
|
});
|
|
});
|