Copyright (c) 2023 Tudor Stanciu
parent
b22c4c3cf6
commit
e788ecbe63
|
@ -2,6 +2,8 @@
|
|||
* @jest-environment jsdom
|
||||
*/
|
||||
|
||||
// Copyright (c) 2023 Tudor Stanciu
|
||||
|
||||
import axios from "axios";
|
||||
import { TuitioClient, fetch, invalidate } from "../client";
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Copyright (c) 2023 Tudor Stanciu
|
||||
|
||||
import { getUrlTemplates } from "../config";
|
||||
import { TuitioClient } from "../client";
|
||||
import type { TuitioAuthenticationResult, TuitioToken } from "../client";
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
* @jest-environment jsdom
|
||||
*/
|
||||
|
||||
// Copyright (c) 2023 Tudor Stanciu
|
||||
|
||||
import { fetch, invalidate } from "../client";
|
||||
|
||||
test("Tuitio empty storage", () => {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Copyright (c) 2023 Tudor Stanciu
|
||||
|
||||
import { combineUrls, isValidURL } from "../utils";
|
||||
|
||||
test("Combine urls with trailing slash", () => {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Copyright (c) 2023 Tudor Stanciu
|
||||
|
||||
import axios from "axios";
|
||||
import { localStorage } from "@flare/js-utils";
|
||||
import { storageKeys } from "./constants";
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Copyright (c) 2023 Tudor Stanciu
|
||||
|
||||
import { combineUrls } from "./utils";
|
||||
|
||||
type UrlTemplates = {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Copyright (c) 2023 Tudor Stanciu
|
||||
|
||||
export const storageKeys: { TOKEN: string; USER: string } = {
|
||||
TOKEN: "TUITIO_AUTHORIZATION_TOKEN",
|
||||
USER: "TUITIO_USER_NAME"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Copyright (c) 2023 Tudor Stanciu
|
||||
|
||||
import { TuitioClient, invalidate, fetch } from "./client";
|
||||
import type { TuitioToken, TuitioAuthenticationResult, TuitioState } from "./client";
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Copyright (c) 2023 Tudor Stanciu
|
||||
|
||||
const combineUrls = (piece1: string, piece2: string): string => {
|
||||
let baseElement = piece1;
|
||||
if (baseElement.endsWith("/")) baseElement = baseElement.substring(0, baseElement.length - 1);
|
||||
|
|
Loading…
Reference in New Issue