1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { sanitizeToken, getClipboardUrl } from "./helpers";
7 describe('helpers', () => {
9 const url = 'https://collections.ardev.roche.com/c=ardev-4zz18-k0hamvtwyit6q56/t=1ha4ykd3w14ed19b2gh3uyjrjup38vsx27x1utwdne0bxcfg5d/LIMS/1.html';
11 describe('sanitizeToken', () => {
12 it('should sanitize token from the url', () => {
14 const result = sanitizeToken(url);
17 expect(result).toBe('https://collections.ardev.roche.com/c=ardev-4zz18-k0hamvtwyit6q56/LIMS/1.html?api_token=1ha4ykd3w14ed19b2gh3uyjrjup38vsx27x1utwdne0bxcfg5d');
21 describe('getClipboardUrl', () => {
22 it('should add redirectTo query param', () => {
24 const result = getClipboardUrl(url);
27 expect(result).toBe('http://localhost?redirectTo=https://collections.ardev.roche.com/c=ardev-4zz18-k0hamvtwyit6q56/LIMS/1.html');