Change code to double-quotes.
parent
1327279816
commit
9ec5d2a708
@ -1,12 +1,12 @@
|
||||
// SPDX-FileCopyrightText: © 2017 EteSync Authors
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
export const appName = 'EteSync';
|
||||
export const homePage = 'https://www.etesync.com/';
|
||||
export const faq = homePage + 'faq/';
|
||||
export const sourceCode = 'https://github.com/etesync/etesync-web';
|
||||
export const reportIssue = sourceCode + '/issues';
|
||||
export const appName = "EteSync";
|
||||
export const homePage = "https://www.etesync.com/";
|
||||
export const faq = homePage + "faq/";
|
||||
export const sourceCode = "https://github.com/etesync/etesync-web";
|
||||
export const reportIssue = sourceCode + "/issues";
|
||||
|
||||
export const forgotPassword = 'https://www.etesync.com/accounts/password/reset/';
|
||||
export const forgotPassword = "https://www.etesync.com/accounts/password/reset/";
|
||||
|
||||
export const serviceApiBase = process.env.REACT_APP_DEFAULT_API_PATH || 'https://api.etesync.com/';
|
||||
export const serviceApiBase = process.env.REACT_APP_DEFAULT_API_PATH || "https://api.etesync.com/";
|
||||
|
@ -1,63 +1,63 @@
|
||||
// SPDX-FileCopyrightText: © 2017 EteSync Authors
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { RouteResolver } from './routes';
|
||||
import { RouteResolver } from "./routes";
|
||||
|
||||
const routes = {
|
||||
home: '',
|
||||
home: "",
|
||||
post: {
|
||||
_base: 'post',
|
||||
_base: "post",
|
||||
_id: {
|
||||
_base: ':postId',
|
||||
comment: 'comment/:commentId',
|
||||
revision: 'history/:revisionId/:someOtherVar/test',
|
||||
_base: ":postId",
|
||||
comment: "comment/:commentId",
|
||||
revision: "history/:revisionId/:someOtherVar/test",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const routeResolver = new RouteResolver(routes);
|
||||
|
||||
it('translating routes', () => {
|
||||
it("translating routes", () => {
|
||||
// Working basic resolves
|
||||
expect(routeResolver.getRoute('home')).toBe('/');
|
||||
expect(routeResolver.getRoute('post')).toBe('/post');
|
||||
expect(routeResolver.getRoute('post._id')).toBe('/post/:postId');
|
||||
expect(routeResolver.getRoute('post._id.comment')).toBe('/post/:postId/comment/:commentId');
|
||||
expect(routeResolver.getRoute("home")).toBe("/");
|
||||
expect(routeResolver.getRoute("post")).toBe("/post");
|
||||
expect(routeResolver.getRoute("post._id")).toBe("/post/:postId");
|
||||
expect(routeResolver.getRoute("post._id.comment")).toBe("/post/:postId/comment/:commentId");
|
||||
|
||||
// Working translation resolves
|
||||
expect(routeResolver.getRoute('home')).toBe('/');
|
||||
expect(routeResolver.getRoute('post')).toBe('/post');
|
||||
expect(routeResolver.getRoute('post._id', { postId: 3 })).toBe('/post/3');
|
||||
expect(routeResolver.getRoute('post._id.comment',
|
||||
{ postId: 3, commentId: 5 })).toBe('/post/3/comment/5');
|
||||
expect(routeResolver.getRoute('post._id.revision',
|
||||
{ postId: 3, revisionId: 5, someOtherVar: 'a' })).toBe('/post/3/history/5/a/test');
|
||||
expect(routeResolver.getRoute("home")).toBe("/");
|
||||
expect(routeResolver.getRoute("post")).toBe("/post");
|
||||
expect(routeResolver.getRoute("post._id", { postId: 3 })).toBe("/post/3");
|
||||
expect(routeResolver.getRoute("post._id.comment",
|
||||
{ postId: 3, commentId: 5 })).toBe("/post/3/comment/5");
|
||||
expect(routeResolver.getRoute("post._id.revision",
|
||||
{ postId: 3, revisionId: 5, someOtherVar: "a" })).toBe("/post/3/history/5/a/test");
|
||||
|
||||
// Failing basic resolves
|
||||
expect(() => {
|
||||
routeResolver.getRoute('bad');
|
||||
routeResolver.getRoute("bad");
|
||||
}).toThrow();
|
||||
expect(() => {
|
||||
routeResolver.getRoute('home.bad');
|
||||
routeResolver.getRoute("home.bad");
|
||||
}).toThrow();
|
||||
expect(() => {
|
||||
routeResolver.getRoute('post._id.bad');
|
||||
routeResolver.getRoute("post._id.bad");
|
||||
}).toThrow();
|
||||
|
||||
// Failing translations
|
||||
expect(() => {
|
||||
routeResolver.getRoute('home', { test: 4 });
|
||||
routeResolver.getRoute("home", { test: 4 });
|
||||
}).toThrow();
|
||||
expect(() => {
|
||||
routeResolver.getRoute('post._id', { test: 4 });
|
||||
routeResolver.getRoute("post._id", { test: 4 });
|
||||
}).toThrow();
|
||||
expect(() => {
|
||||
routeResolver.getRoute('post._id', { postId: 3, test: 4 });
|
||||
routeResolver.getRoute("post._id", { postId: 3, test: 4 });
|
||||
}).toThrow();
|
||||
expect(() => {
|
||||
routeResolver.getRoute('post._id.comment', { postId: 3, commentId: 5, test: 4 });
|
||||
routeResolver.getRoute("post._id.comment", { postId: 3, commentId: 5, test: 4 });
|
||||
}).toThrow();
|
||||
expect(() => {
|
||||
routeResolver.getRoute('post._id.comment', { postId: 3 });
|
||||
routeResolver.getRoute("post._id.comment", { postId: 3 });
|
||||
}).toThrow();
|
||||
});
|
||||
|
@ -1,6 +1,6 @@
|
||||
// SPDX-FileCopyrightText: © 2017 EteSync Authors
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
declare module 'redux-persist';
|
||||
declare module 'redux-persist/lib/storage/session';
|
||||
declare module 'redux-persist/es/integration/react';
|
||||
declare module "redux-persist";
|
||||
declare module "redux-persist/lib/storage/session";
|
||||
declare module "redux-persist/es/integration/react";
|
||||
|
Loading…
Reference in New Issue