level_0 int64 0 10k | index int64 0 0 | repo_id stringlengths 22 152 | file_path stringlengths 41 203 | content stringlengths 11 11.5M |
|---|---|---|---|---|
9,866 | 0 | petrpan-code/alibaba/ice/tests | petrpan-code/alibaba/ice/tests/integration/routes-generate.test.ts | import { expect, test, describe, afterAll } from 'vitest';
import { buildFixture, setupBrowser } from '../utils/build';
import { startFixture, setupStartBrowser } from '../utils/start';
import type { Page } from '../utils/browser';
import type Browser from '../utils/browser';
const example = 'routes-generate';
descri... |
9,867 | 0 | petrpan-code/alibaba/ice/tests | petrpan-code/alibaba/ice/tests/integration/single-router.test.ts | import * as path from 'path';
import * as fs from 'fs';
import { expect, test, describe, afterAll } from 'vitest';
import { buildFixture } from '../utils/build';
const example = 'single-route';
describe(`build ${example}`, () => {
let sizeWithOptimize = 0;
let sizeWithoutOptimize = 0;
test('optimize router', a... |
9,868 | 0 | petrpan-code/alibaba/ice/tests | petrpan-code/alibaba/ice/tests/integration/with-antd-mobile.test.ts | import { expect, test, describe, afterAll } from 'vitest';
import { buildFixture, setupBrowser } from '../utils/build';
import type { Page } from '../utils/browser';
import type Browser from '../utils/browser';
const example = 'with-antd-mobile';
describe(`build ${example}`, () => {
let page: Page;
let browser: B... |
9,869 | 0 | petrpan-code/alibaba/ice/tests | petrpan-code/alibaba/ice/tests/integration/with-auth.test.ts | import { expect, test, describe, afterAll } from 'vitest';
import { buildFixture, setupBrowser } from '../utils/build';
import { startFixture, setupStartBrowser } from '../utils/start';
import type { Page } from '../utils/browser';
import type Browser from '../utils/browser';
const example = 'with-auth';
describe(`bu... |
9,870 | 0 | petrpan-code/alibaba/ice/tests | petrpan-code/alibaba/ice/tests/integration/with-data-loader.test.ts | import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
import { expect, test, describe, afterAll } from 'vitest';
import { buildFixture } from '../utils/build';
import { startFixture, setupStartBrowser } from '../utils/start';
import type { Page } from '../utils/browser';
import type Browser... |
9,871 | 0 | petrpan-code/alibaba/ice/tests | petrpan-code/alibaba/ice/tests/integration/with-i18n.test.ts | import * as path from 'path';
import glob from 'glob';
import { expect, test, describe, afterAll } from 'vitest';
import { buildFixture, setupBrowser } from '../utils/build';
import type { Page } from '../utils/browser';
import type Browser from '../utils/browser';
const example = 'with-i18n';
describe(`build ${examp... |
9,872 | 0 | petrpan-code/alibaba/ice/tests | petrpan-code/alibaba/ice/tests/integration/with-request.test.ts | import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
import { expect, test, describe } from 'vitest';
import { buildFixture } from '../utils/build';
// @ts-ignore
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const example = 'with-request';
describe(`build ${example}`, ... |
9,873 | 0 | petrpan-code/alibaba/ice/tests | petrpan-code/alibaba/ice/tests/integration/with-ssg.test.ts | import { expect, test, describe, afterAll } from 'vitest';
import { startFixture, setupStartBrowser } from '../utils/start';
import type { Page } from '../utils/browser';
import type Browser from '../utils/browser';
const example = 'with-ssg';
describe(`start ${example}`, () => {
let page: Page;
let browser: Brow... |
9,874 | 0 | petrpan-code/alibaba/ice/tests | petrpan-code/alibaba/ice/tests/integration/with-store.test.ts | import * as path from 'path';
import * as fs from 'fs';
import { expect, test, describe, afterAll } from 'vitest';
import { buildFixture, setupBrowser } from '../utils/build';
import type { Page } from '../utils/browser';
import type Browser from '../utils/browser';
const example = 'with-store';
describe(`build ${exa... |
9,875 | 0 | petrpan-code/alibaba/ice/tests | petrpan-code/alibaba/ice/tests/integration/with-suspense-ssr.test.ts | import { expect, test, describe, afterAll } from 'vitest';
import { startFixture, setupStartBrowser } from '../utils/start';
import type { Page } from '../utils/browser';
import type Browser from '../utils/browser';
const example = 'with-suspense-ssr';
describe(`start ${example}`, () => {
let page: Page;
let brow... |
4 | 0 | petrpan-code/outline/outline/server | petrpan-code/outline/outline/server/utils/parseAttachmentIds.test.ts | import { expect } from "@jest/globals";
import { v4 as uuidv4 } from "uuid";
import env from "@server/env";
import parseAttachmentIds from "./parseAttachmentIds";
it("should return an empty array with no matches", () => {
expect(parseAttachmentIds(`some random text`).length).toBe(0);
});
it("should not return orpha... |
6 | 0 | petrpan-code/outline/outline/server | petrpan-code/outline/outline/server/utils/parseDocumentIds.test.ts | import parseDocumentIds from "./parseDocumentIds";
it("should not return non links", () => {
expect(parseDocumentIds(`# Header`).length).toBe(0);
});
it("should return an array of document ids", () => {
const result = parseDocumentIds(`# Header
[internal](http://app.getoutline.com/doc/test-456733)
More te... |
8 | 0 | petrpan-code/outline/outline/server | petrpan-code/outline/outline/server/utils/parseImages.test.ts | import parseImages from "./parseImages";
it("should not return non images", () => {
expect(parseImages(`# Header`).length).toBe(0);
});
it("should return an array of images", () => {
const result = parseImages(`# Header

`);
expect(result.length).toBe(1);
expect(resul... |
69 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/Abstract.test.ts | import Abstract from "./Abstract";
describe("Abstract", () => {
const match = Abstract.ENABLED[0];
const match2 = Abstract.ENABLED[1];
test("to be enabled on share subdomain link", () => {
expect(
"https://share.goabstract.com/aaec8bba-f473-4f64-96e7-bff41c70ff8a".match(
match
)
).to... |
71 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/Airtable.test.ts | import Airtable from "./Airtable";
describe("Airtable", () => {
const match = Airtable.ENABLED[0];
test("to be enabled on share link", () => {
expect("https://airtable.com/shrEoQs3erLnppMie".match(match)).toBeTruthy();
expect(
"https://airtable.com/shrEoQs3erLnppMie/tbl232i54yebXpr1J".match(match)
... |
73 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/Berrycast.test.ts | import Berrycast from "./Berrycast";
describe("Berrycast", () => {
Berrycast.ENABLED[0];
// TODO
test.todo("");
});
|
75 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/Bilibili.test.ts | import Bilibili from "./Bilibili";
describe("Bilibili", () => {
const match = Bilibili.ENABLED[0];
test("to be enabled on video link", () => {
expect(
"https://www.bilibili.com/video/BV1CV411s7jd?spm_id_from=333.999.0.0".match(
match
)
).toBeTruthy();
});
test("to not be enabled e... |
78 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/Cawemo.test.ts | import Cawemo from "./Cawemo";
describe("Cawemo", () => {
const match = Cawemo.ENABLED[0];
test("to be enabled on embed link", () => {
expect(
"https://cawemo.com/embed/a82e9f22-e283-4253-8d11".match(match)
).toBeTruthy();
});
test("to be enabled on share link", () => {
expect(
"https... |
80 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/ClickUp.test.ts | import ClickUp from "./ClickUp";
describe("ClickUp", () => {
const match = ClickUp.ENABLED[0];
test("to be enabled on share link", () => {
expect(
"https://share.clickup.com/b/h/6-9310960-2/c9d837d74182317".match(match)
).toBeTruthy();
});
test("to not be enabled elsewhere", () => {
expect(... |
82 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/Codepen.test.ts | import Codepen from "./Codepen";
describe("Codepen", () => {
const match = Codepen.ENABLED[0];
test("to be enabled on pen link", () => {
expect(
"https://codepen.io/chriscoyier/pen/gfdDu".match(match)
).toBeTruthy();
});
test("to be enabled on embed link", () => {
expect(
"https://cod... |
84 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/DBDiagram.test.ts | import DBDiagram from "./DBDiagram";
describe("DBDiagram", () => {
DBDiagram.ENABLED[0];
// TODO
test.todo("");
});
|
86 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/Descript.test.ts | import Descript from "./Descript";
describe("Descript", () => {
const match = Descript.ENABLED[0];
test("to not be enabled elsewhere", () => {
expect("https://shareddescript.com/view/c9d8".match(match)).toBe(null);
expect("https://share.descriptdcom/view/c9d8".match(match)).toBe(null);
});
});
|
88 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/Diagrams.test.ts | import Diagrams from "./Diagrams";
describe("Diagrams", () => {
const match = Diagrams.ENABLED[0];
test("to be enabled on viewer link", () => {
expect(
"https://viewer.diagrams.net/?target=blank&nav=1#ABCDefgh_A12345-6789".match(
match
)
).toBeTruthy();
});
test("to not be enabled... |
90 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/Figma.test.ts | import Figma from "./Figma";
describe("Figma", () => {
const match = Figma.ENABLED[0];
test("to be enabled on file link", () => {
expect(
"https://www.figma.com/file/LKQ4FJ4bTnCSjedbRpk931".match(match)
).toBeTruthy();
});
test("to be enabled on prototype link", () => {
expect(
"https... |
92 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/Framer.test.ts | import Framer from "./Framer";
describe("Framer", () => {
const match = Framer.ENABLED[0];
test("to be enabled on share link", () => {
expect("https://framer.cloud/PVwJO".match(match)).toBeTruthy();
});
test("to not be enabled on root", () => {
expect("https://framer.cloud".match(match)).toBe(null);
... |
94 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/Gist.test.ts | import Gist from "./Gist";
describe("Gist", () => {
const match = Gist.ENABLED[0];
test("to be enabled on gist link", () => {
expect(
"https://gist.github.com/wmertens/0b4fd66ca7055fd290ecc4b9d95271a9".match(
match
)
).toBeTruthy();
expect(
"https://gist.github.com/n3n/eb51ad... |
96 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/Gliffy.test.ts | import Gliffy from "./Gliffy";
describe("Gliffy", () => {
const match = Gliffy.ENABLED[0];
test("to not be enabled elsewhere", () => {
expect("https://gotgliffy.com/go/share/c9d837d74182317".match(match)).toBe(
null
);
expect("https://go.gliffyycom/go/share/c9d837d74182317".match(match)).toBe(
... |
98 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/GoogleCalendar.test.ts | import GoogleCalendar from "./GoogleCalendar";
describe("GoogleCalendar", () => {
const match = GoogleCalendar.ENABLED[0];
test("to be enabled on share link", () => {
expect(
"https://calendar.google.com/calendar/embed?src=tom%40outline.com&ctz=America%2FSao_Paulo".match(
match
)
).toB... |
100 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/GoogleDocs.test.ts | import GoogleDocs from "./GoogleDocs";
describe("GoogleDocs", () => {
const match = GoogleDocs.ENABLED[0];
test("to be enabled on share link", () => {
expect(
"https://docs.google.com/document/d/e/2PACX-1vTdddHPoZ5M_47wmSHCoigRIt2cj_Pd-kgtaNQY6H0Jzn0_CVGbxC1GcK5IoNzU615lzguexFwxasAW/pubhtml".match(
... |
102 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/GoogleDrawings.test.ts | import GoogleDrawings from "./GoogleDrawings";
describe("GoogleDrawings", () => {
const match = GoogleDrawings.ENABLED[0];
test("to be enabled on share link", () => {
expect(
"https://docs.google.com/drawings/d/1zELtJ4HSCnjGCGSoCgqGe3F8p6o7R8Vjk8MDR6dKf-U/edit".match(
match
)
).toBeTru... |
104 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/GoogleDrive.test.ts | import GoogleDrive from "./GoogleDrive";
describe("GoogleDrive", () => {
const match = GoogleDrive.ENABLED[0];
test("to be enabled on share link", () => {
expect(
"https://drive.google.com/file/d/1ohkOgmE8MiNx68u6ynBfYkgjeKu_x3ZK/view?usp=sharing".match(
match
)
).toBeTruthy();
exp... |
106 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/GoogleForms.test.ts | import GoogleForms from "./GoogleForms";
describe("GoogleForms", () => {
const match = GoogleForms.ENABLED[0];
test("to be enabled on long-form share links", () => {
expect(
"https://docs.google.com/forms/d/e/1FAIpQLSetbCGiE8DhfVQZMtLE_CU2MwpSsrkXi690hkEDREOvMu8VYQ/viewform?usp=sf_link".match(
m... |
108 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/GoogleLookerStudio.test.ts | import GoogleLookerStudio from "./GoogleLookerStudio";
describe("GoogleLookerStudio", () => {
const match = GoogleLookerStudio.ENABLED[0];
test("to be enabled on share link", () => {
expect(
"https://lookerstudio.google.com/embed/reporting/aab01789-f3a2-4ff3-9cba-c4c94c4a92e8/page/7zFD".match(
m... |
110 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/GoogleMaps.test.ts | import GoogleMaps from "./GoogleMaps";
describe("GoogleMaps", () => {
const match = GoogleMaps.ENABLED[0];
test("to be enabled", () => {
expect(
"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d50977.036904273686!2d174.74383592605594!3d-37.00825027293197!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3... |
112 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/GoogleSheets.test.ts | import GoogleSheets from "./GoogleSheets";
describe("GoogleSheets", () => {
const match = GoogleSheets.ENABLED[0];
test("to be enabled on share link", () => {
expect(
"https://docs.google.com/spreadsheets/d/e/2PACX-1vTdddHPoZ5M_47wmSHCoigRIt2cj_Pd-kgtaNQY6H0Jzn0_CVGbxC1GcK5IoNzU615lzguexFwxasAW/pub".mat... |
114 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/GoogleSlides.test.ts | import GoogleSlides from "./GoogleSlides";
describe("GoogleSlides", () => {
const match = GoogleSlides.ENABLED[0];
test("to be enabled on share link", () => {
expect(
"https://docs.google.com/presentation/d/e/2PACX-1vTdddHPoZ5M_47wmSHCoigRIt2cj_Pd-kgtaNQY6H0Jzn0_CVGbxC1GcK5IoNzU615lzguexFwxasAW/pub?star... |
116 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/Grist.test.tsx | import Grist from "./Grist";
describe("Grist", () => {
const match = Grist.ENABLED[0];
test("to be enabled on share link", () => {
expect(
"https://templates.getgrist.com/doc/afterschool-program/p/2?embed=true".match(
match
)
).toBeTruthy();
expect(
"https://docs.getgrist.com... |
118 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/InVision.test.ts | import InVision from "./InVision";
describe("InVision", () => {
const match = InVision.ENABLED[0];
test("to be enabled on shortlink", () => {
expect("https://invis.io/69PG07QYQTE".match(match)).toBeTruthy();
});
test("to be enabled on share", () => {
expect(
"https://projects.invisionapp.com/sh... |
120 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/Instagram.test.ts | import Instagram from "./Instagram";
describe("Instagram", () => {
const match = Instagram.ENABLED[0];
test("to be enabled on post link", () => {
expect(
"https://www.instagram.com/p/CrL74G6Bxgw/?utm_source=ig_web_copy_link".match(
match
)
).toBeTruthy();
});
test("to be enabled o... |
122 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/JSFiddle.test.ts | import JSFiddle from "./JSFiddle";
describe("JSFiddle", () => {
const match = JSFiddle.ENABLED[0];
test("to not be enabled for invalid urls", () => {
expect("https://jsfiddleenet/go/share/c9d837d74182317".match(match)).toBe(
null
);
});
});
|
124 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/Linkedin.test.ts | import Linkedin from "./Linkedin";
describe("Linkedin", () => {
const match = Linkedin.ENABLED[0];
test("to be enabled on post link", () => {
expect(
"https://www.linkedin.com/posts/github_highlight-your-expertise-with-github-certifications-activity-7117157514097352704-F4Mz?utm_source=share&utm_medium=m... |
126 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/Loom.test.ts | import Loom from "./Loom";
describe("Loom", () => {
const match = Loom.ENABLED[0];
test("to be enabled on share link", () => {
expect(
"https://www.loom.com/share/55327cbb265743f39c2c442c029277e0".match(match)
).toBeTruthy();
expect(
"https://www.useloom.com/share/55327cbb265743f39c2c442c0... |
128 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/Lucidchart.test.ts | import Lucidchart from "./Lucidchart";
describe("Lucidchart", () => {
const match = Lucidchart.ENABLED[0];
test("to be enabled on view link", () => {
expect(
"https://www.lucidchart.com/documents/view/2f4a79cb-7637-433d-8ffb-27cce65a05e7".match(
match
)
).toBeTruthy();
});
test("t... |
130 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/Marvel.test.ts | import Marvel from "./Marvel";
describe("Marvel", () => {
const match = Marvel.ENABLED[0];
test("to be enabled on share link", () => {
expect("https://marvelapp.com/75hj91".match(match)).toBeTruthy();
});
test("to not be enabled elsewhere", () => {
expect("https://marvelapp.com".match(match)).toBe(nu... |
132 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/Mindmeister.test.ts | import Mindmeister from "./Mindmeister";
describe("Mindmeister", () => {
const match = Mindmeister.ENABLED[0];
test("to be enabled on mm.tt link", () => {
expect("https://mm.tt/326377934".match(match)).toBeTruthy();
});
test("to be enabled on mm.tt link with token parameter", () => {
expect("https://... |
134 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/Miro.test.ts | import Miro from "./Miro";
describe("Miro", () => {
const match = Miro.ENABLED[0];
test("to be enabled on old domain share link", () => {
expect(
"https://realtimeboard.com/app/board/o9J_k0fwiss=".match(match)
).toBeTruthy();
});
test("to be enabled on share link", () => {
expect("https://m... |
136 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/ModeAnalytics.test.ts | import ModeAnalytics from "./ModeAnalytics";
describe("ModeAnalytics", () => {
const match = ModeAnalytics.ENABLED[0];
test("to be enabled on report link", () => {
expect(
"https://modeanalytics.com/outline/reports/5aca06064f56".match(match)
).toBeTruthy();
});
test("to not be enabled elsewhere... |
138 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/Otter.test.ts | import Otter from "./Otter";
describe("Otter", () => {
const match = Otter.ENABLED[0];
test("to not be enabled for invalid urls", () => {
expect("https://otterrai/s/c9d837d74182317".match(match)).toBe(null);
});
});
|
140 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/Pitch.test.ts | import Pitch from "./Pitch";
describe("Pitch", () => {
const match = Pitch.ENABLED[0];
test("to not be enabled elsewhere", () => {
expect(
"https://appppitch.com/app/presentation/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa/player/c9d837d74182317".match(
match
)
).toBe(null);
expect(
... |
142 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/Prezi.test.ts | import Prezi from "./Prezi";
describe("Prezi", () => {
const match = Prezi.ENABLED[0];
test("to be enabled on share link", () => {
expect(
"https://prezi.com/view/39mn8Rn1ZkoeEKQCgk5C".match(match)
).toBeTruthy();
});
test("to be enabled on embed link", () => {
expect(
"https://prezi.... |
145 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/Spotify.test.ts | import Spotify from "./Spotify";
describe("Spotify", () => {
const match = Spotify.ENABLED[0];
test("to be enabled on song link", () => {
expect(
"https://open.spotify.com/track/29G1ScCUhgjgI0H72qN4DE?si=DxjEUxV2Tjmk6pSVckPDRg".match(
match
)
).toBeTruthy();
});
test("to be enable... |
147 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/Tldraw.test.ts | import Tldraw from "./Tldraw";
describe("Tldraw", () => {
const match = Tldraw.ENABLED[0];
test("to be enabled on share link", () => {
expect(
"https://beta.tldraw.com/r/v2_c_r5WVtGaktE99D3wyFFsoL".match(match)
).toBeTruthy();
});
test("to not be enabled elsewhere", () => {
expect("https://... |
149 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/Trello.test.ts | import Trello from "./Trello";
describe("Trello", () => {
const match = Trello.ENABLED[0];
test("to not be enabled for invalid urls", () => {
expect("https://trelloocom/c/c9d837d74182317".match(match)).toBe(null);
});
});
|
151 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/Typeform.test.ts | import Typeform from "./Typeform";
describe("Typeform", () => {
const match = Typeform.ENABLED[0];
test("to be enabled on share link", () => {
expect(
"https://beardyman.typeform.com/to/zvlr4L".match(match)
).toBeTruthy();
});
test("to not be enabled elsewhere", () => {
expect("https://www.... |
154 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/Vimeo.test.ts | import Vimeo from "./Vimeo";
describe("Vimeo", () => {
const match = Vimeo.ENABLED[0];
test("to be enabled on video link", () => {
expect("https://vimeo.com/265045525".match(match)).toBeTruthy();
expect("https://vimeo.com/265045525/b9fefc8598".match(match)).toBeTruthy();
});
test("to not be enabled e... |
156 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/Whimsical.test.ts | import Whimsical from "./Whimsical";
describe("Whimsical", () => {
const match = Whimsical.ENABLED[0];
test("to not be enabled for invalid urls", () => {
expect("https://whimsicallcom/a-c9d837d74182317".match(match)).toBe(null);
});
});
|
158 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/embeds/YouTube.test.ts | import YouTube from "./YouTube";
describe("YouTube", () => {
const match = YouTube.ENABLED[0];
test("to be enabled on video link", () => {
expect(
"https://www.youtube.com/watch?v=dQw4w9WgXcQ".match(match)
).toBeTruthy();
});
test("to be enabled on video link with timestamp", () => {
expect... |
179 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/lib/emoji.test.ts | import { getNameFromEmoji, getEmojiFromName } from "./emoji";
describe("getNameFromEmoji", () => {
it("returns the correct shortcode", () => {
expect(getNameFromEmoji("🤔")).toBe("thinking_face");
});
});
describe("getEmojiFromName", () => {
it("returns the correct native character", () => {
expect(getE... |
181 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/lib/filterExcessSeparators.test.ts | import filterExcessSeparators from "./filterExcessSeparators";
const embedDescriptor = {
icon: () => null,
matcher: () => true,
component: () => null,
};
describe("filterExcessSeparators", () => {
test("filter hanging end separators", () => {
expect(
filterExcessSeparators([
embedDescriptor,... |
185 | 0 | petrpan-code/outline/outline/shared/editor | petrpan-code/outline/outline/shared/editor/lib/isMarkdown.test.ts | import isMarkdown from "./isMarkdown";
test("returns false for an empty string", () => {
expect(isMarkdown("")).toBe(false);
});
test("returns false for plain text", () => {
expect(isMarkdown("plain text")).toBe(false);
});
test("returns true for bullet list", () => {
expect(
isMarkdown(`- item one
- item ... |
313 | 0 | petrpan-code/outline/outline/shared | petrpan-code/outline/outline/shared/utils/domains.test.ts | import env from "../env";
import { parseDomain, getCookieDomain, slugifyDomain } from "./domains";
// test suite is based on subset of parse-domain module we want to support
// https://github.com/peerigon/parse-domain/blob/master/test/parseDomain.test.js
describe("#parseDomain", () => {
beforeEach(() => {
env.UR... |
316 | 0 | petrpan-code/outline/outline/shared | petrpan-code/outline/outline/shared/utils/files.test.ts | import { bytesToHumanReadable } from "./files";
describe("bytesToHumanReadable", () => {
test("Outputs readable string", () => {
expect(bytesToHumanReadable(0)).toBe("0 Bytes");
expect(bytesToHumanReadable(500)).toBe("500 Bytes");
expect(bytesToHumanReadable(1000)).toBe("1 kB");
expect(bytesToHumanRe... |
320 | 0 | petrpan-code/outline/outline/shared | petrpan-code/outline/outline/shared/utils/naturalSort.test.ts | import naturalSort from "./naturalSort";
describe("#naturalSort", () => {
it("should sort a list of objects by the given key", () => {
const items = [
{
name: "Joan",
},
{
name: "Pedro",
},
{
name: "Mark",
},
];
expect(naturalSort(items, "name")... |
322 | 0 | petrpan-code/outline/outline/shared | petrpan-code/outline/outline/shared/utils/parseDocumentSlug.test.ts | import parseDocumentSlug from "./parseDocumentSlug";
describe("#parseDocumentSlug", () => {
it("should work with fully qualified url", () => {
expect(
parseDocumentSlug("http://example.com/doc/my-doc-y4j4tR4UuV")
).toEqual("my-doc-y4j4tR4UuV");
});
it("should work with paths after document slug", ... |
325 | 0 | petrpan-code/outline/outline/shared | petrpan-code/outline/outline/shared/utils/parseTitle.test.ts | import parseTitle from "./parseTitle";
it("should trim the title", () => {
expect(parseTitle(`# Lots of space `).title).toBe("Lots of space");
});
it("should extract first title", () => {
expect(parseTitle(`# Title one\n# Title two`).title).toBe("Title one");
});
it("should parse emoji if first character", ... |
332 | 0 | petrpan-code/outline/outline/shared | petrpan-code/outline/outline/shared/utils/urls.test.ts | import * as urlsUtils from "./urls";
import { urlRegex } from "./urls";
describe("isUrl", () => {
it("should return false for invalid url", () => {
expect(urlsUtils.isUrl("")).toBe(false);
expect(urlsUtils.isUrl("#invalidurl")).toBe(false);
expect(urlsUtils.isUrl("mailto:")).toBe(false);
expect(urlsU... |
1,764 | 0 | petrpan-code/medusajs/medusa/packages/design-system | petrpan-code/medusajs/medusa/packages/design-system/icons/setup-test.ts | import "@testing-library/jest-dom"
import { JSDOM } from "jsdom"
import ResizeObserver from "resize-observer-polyfill"
const { window } = new JSDOM()
window.ResizeObserver = ResizeObserver
global.ResizeObserver = ResizeObserver
window.Element.prototype.scrollTo = () => {
// no-op
}
window.requestAnimationFrame = (c... |
2,317 | 0 | petrpan-code/medusajs/medusa/packages/design-system | petrpan-code/medusajs/medusa/packages/design-system/ui/setup-test.ts | import "@testing-library/jest-dom"
import { JSDOM } from "jsdom"
import ResizeObserver from "resize-observer-polyfill"
const { window } = new JSDOM()
window.ResizeObserver = ResizeObserver
global.ResizeObserver = ResizeObserver
window.Element.prototype.scrollTo = () => {
// no-op
}
window.requestAnimationFrame = (c... |
2,507 | 0 | petrpan-code/medusajs/medusa/packages/gatsby-source-medusa/src | petrpan-code/medusajs/medusa/packages/gatsby-source-medusa/src/__tests__/process-node.test.ts | const { processNode } = require("../process-node.ts")
describe("helper functions", () => {
it("should return return a new node from processNode", () => {
const fieldName = "product"
const node = {
id: "prod_test_1234",
title: "Test Shirt",
description: "A test product",
unit_price: 25... |
2,508 | 0 | petrpan-code/medusajs/medusa/packages/gatsby-source-medusa/src/__tests__ | petrpan-code/medusajs/medusa/packages/gatsby-source-medusa/src/__tests__/__snapshots__/process-node.test.ts.snap | // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`helper functions should return return a new node from processNode 1`] = `
Array [
Object {
"children": Array [],
"description": "A test product",
"id": "prod_test_1234",
"internal": Object {
"content": "{\\"id\\":\\"prod_test_1234\\",\\"title\... |
3,255 | 0 | petrpan-code/medusajs/medusa/packages/medusa-js/src/test | petrpan-code/medusajs/medusa/packages/medusa-js/src/test/utils/utils.test.ts | const { stringifyNullProperties } = require("../../utils")
describe("stringifyNullProperties", () => {
test("returns empty object on no props", () => {
const result = stringifyNullProperties({})
expect(result).toEqual({})
})
test("successfully stringifies null property", () => {
const result = strin... |
3,355 | 0 | petrpan-code/medusajs/medusa/packages/medusa-payment-stripe/src/core | petrpan-code/medusajs/medusa/packages/medusa-payment-stripe/src/core/__fixtures__/stripe-test.ts | import StripeBase from "../stripe-base"
import { PaymentIntentOptions } from "../../types"
export class StripeTest extends StripeBase {
constructor(_, options) {
super(_, options)
}
get paymentIntentOptions(): PaymentIntentOptions {
return {}
}
}
|
3,729 | 0 | petrpan-code/medusajs/medusa/packages/medusa-react/test | petrpan-code/medusajs/medusa/packages/medusa-react/test/cart-context/cart.test.ts | import { useCart } from "../../src"
import { act, renderHook } from "@testing-library/react-hooks"
import { fixtures } from "../../mocks/data"
import { createCartWrapper } from "../utils"
import { Cart } from "../../src/types"
describe("useBag hook", () => {
describe("sets a cart", () => {
test("success", async ... |
3,730 | 0 | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin/auth/mutations.test.ts | import { renderHook } from "@testing-library/react-hooks/dom"
import { fixtures } from "../../../../mocks/data"
import { useAdminDeleteSession, useAdminLogin } from "../../../../src/"
import { createWrapper } from "../../../utils"
describe("useAdminLogin hook", () => {
test("logs in a user", async () => {
const ... |
3,731 | 0 | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin/auth/queries.test.ts | import { renderHook } from "@testing-library/react-hooks/dom"
import { fixtures } from "../../../../mocks/data"
import { useAdminGetSession } from "../../../../src"
import { createWrapper } from "../../../utils"
describe("useAdminGetSession hook", () => {
test("returns the authenticated user", async () => {
cons... |
3,732 | 0 | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin/batch-jobs/mutations.test.ts | import { renderHook } from "@testing-library/react-hooks/dom"
import { fixtures } from "../../../../mocks/data"
import {
useAdminCancelBatchJob,
useAdminConfirmBatchJob,
useAdminCreateBatchJob,
} from "../../../../src"
import { createWrapper } from "../../../utils"
describe("useAdminCreateBatchJob hook", () => {... |
3,733 | 0 | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin/batch-jobs/queries.test.ts | import { renderHook } from "@testing-library/react-hooks/dom"
import { fixtures } from "../../../../mocks/data"
import { useAdminBatchJob, useAdminBatchJobs } from "../../../../src"
import { createWrapper } from "../../../utils"
describe("useAdminBatchJobs hook", () => {
test("returns a list of batch job", async () ... |
3,734 | 0 | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin/claims/mutations.test.ts | import { renderHook } from "@testing-library/react-hooks/dom"
import { fixtures } from "../../../../mocks/data"
import {
useAdminCancelClaim,
useAdminCancelClaimFulfillment,
useAdminCreateClaim,
useAdminCreateClaimShipment,
useAdminFulfillClaim,
useAdminUpdateClaim,
} from "../../../../src/"
import { create... |
3,735 | 0 | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin/collections/mutations.test.ts | import { renderHook } from "@testing-library/react-hooks/dom"
import { fixtures } from "../../../../mocks/data"
import {
useAdminAddProductsToCollection,
useAdminCreateCollection,
useAdminDeleteCollection,
useAdminRemoveProductsFromCollection,
useAdminUpdateCollection,
} from "../../../../src/"
import { creat... |
3,736 | 0 | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin/collections/queries.test.ts | import { renderHook } from "@testing-library/react-hooks/dom"
import { fixtures } from "../../../../mocks/data"
import { useAdminCollection, useAdminCollections } from "../../../../src"
import { createWrapper } from "../../../utils"
describe("useAdminCollections hook", () => {
test("returns a list of collections", a... |
3,737 | 0 | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin/currencies/mutation.test.ts | import { renderHook } from "@testing-library/react-hooks/dom"
import { fixtures } from "../../../../mocks/data"
import { useAdminUpdateCurrency } from "../../../../src/"
import { createWrapper } from "../../../utils"
describe("useAdminUpdateCurrency hook", () => {
test("updates a currency and returns it", async () =... |
3,738 | 0 | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin/currencies/queries.test.ts | import { renderHook } from "@testing-library/react-hooks/dom"
import { fixtures } from "../../../../mocks/data"
import { useAdminCurrencies } from "../../../../src"
import { createWrapper } from "../../../utils"
describe("useAdminCurrencies hook", () => {
test("returns a list of currencies", async () => {
const ... |
3,739 | 0 | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin/customer-groups/mutations.test.ts | import { renderHook } from "@testing-library/react-hooks/dom"
import { fixtures } from "../../../../mocks/data"
import {
useAdminCreateCustomerGroup,
useAdminUpdateCustomerGroup,
} from "../../../../src/"
import { createWrapper } from "../../../utils"
describe("useAdminCreateCustomerGroup hook", () => {
test("c... |
3,740 | 0 | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin/customer-groups/queries.test.ts | import { renderHook } from "@testing-library/react-hooks/dom"
import { fixtures } from "../../../../mocks/data"
import {
useAdminCustomerGroup,
useAdminCustomerGroupCustomers,
useAdminCustomerGroups,
} from "../../../../src"
import { createWrapper } from "../../../utils"
describe("useAdminCustomerGroup hook", (... |
3,741 | 0 | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin/customers/mutations.test.ts | import { renderHook } from "@testing-library/react-hooks/dom"
import { fixtures } from "../../../../mocks/data"
import {
useAdminCreateCustomer,
useAdminUpdateCustomer,
} from "../../../../src/"
import { createWrapper } from "../../../utils"
describe("useAdminCreateCustomer hook", () => {
test("creates a custome... |
3,742 | 0 | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin/customers/queries.test.ts | import { renderHook } from "@testing-library/react-hooks/dom"
import { fixtures } from "../../../../mocks/data"
import { useAdminCustomer, useAdminCustomers } from "../../../../src"
import { createWrapper } from "../../../utils"
describe("useAdminCustomers hook", () => {
test("returns a list of customers", async () ... |
3,743 | 0 | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin/discounts/mutations.test.ts | import { DiscountConditionOperator } from "@medusajs/medusa"
import { renderHook } from "@testing-library/react-hooks/dom"
import { fixtures } from "../../../../mocks/data"
import {
useAdminAddDiscountConditionResourceBatch,
useAdminCreateDiscount,
useAdminCreateDynamicDiscountCode,
useAdminDeleteDiscount,
us... |
3,744 | 0 | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin/discounts/queries.test.ts | import { renderHook } from "@testing-library/react-hooks/dom"
import { fixtures } from "../../../../mocks/data"
import {
useAdminDiscount,
useAdminDiscounts,
useAdminGetDiscountByCode,
useAdminGetDiscountCondition,
} from "../../../../src"
import { createWrapper } from "../../../utils"
describe("useAdminDiscou... |
3,745 | 0 | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin/draft-orders/mutations.test.ts | import { renderHook } from "@testing-library/react-hooks/dom"
import { fixtures } from "../../../../mocks/data"
import {
useAdminCreateDraftOrder,
useAdminDeleteDraftOrder,
useAdminDraftOrderAddLineItem,
useAdminDraftOrderRegisterPayment,
useAdminDraftOrderRemoveLineItem,
useAdminDraftOrderUpdateLineItem,
... |
3,746 | 0 | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin/draft-orders/queries.test.ts | import { renderHook } from "@testing-library/react-hooks/dom"
import { fixtures } from "../../../../mocks/data"
import { useAdminDraftOrder, useAdminDraftOrders } from "../../../../src"
import { createWrapper } from "../../../utils"
describe("useAdminDraftOrders hook", () => {
test("returns a list of draft orders", ... |
3,747 | 0 | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin/gift-cards/mutations.test.ts | import { renderHook } from "@testing-library/react-hooks/dom"
import { fixtures } from "../../../../mocks/data"
import {
useAdminCreateGiftCard,
useAdminDeleteGiftCard,
useAdminUpdateGiftCard,
} from "../../../../src/"
import { createWrapper } from "../../../utils"
describe("useAdminCreateGiftCard hook", () => {... |
3,748 | 0 | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin/gift-cards/queries.test.ts | import { renderHook } from "@testing-library/react-hooks/dom"
import { fixtures } from "../../../../mocks/data"
import { useAdminGiftCard, useAdminGiftCards } from "../../../../src"
import { createWrapper } from "../../../utils"
describe("useAdminGiftCards hook", () => {
test("returns a list of giftCards", async () ... |
3,749 | 0 | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin/inventory-items/mutations.test.ts | import { renderHook } from "@testing-library/react-hooks/dom"
import {
useAdminCreateLocationLevel,
useAdminDeleteInventoryItem,
useAdminDeleteLocationLevel,
useAdminUpdateInventoryItem,
useAdminUpdateLocationLevel,
} from "../../../../src/"
import { createWrapper } from "../../../utils"
describe("useAdminUp... |
3,750 | 0 | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin/inventory-items/queries.test.ts | import { renderHook } from "@testing-library/react-hooks/dom"
import { fixtures } from "../../../../mocks/data"
import {
useAdminInventoryItem,
useAdminInventoryItemLocationLevels,
useAdminInventoryItems,
useAdminPriceList,
} from "../../../../src"
import { createWrapper } from "../../../utils"
describe("useAd... |
3,751 | 0 | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin/invites/mutations.test.ts | import { renderHook } from "@testing-library/react-hooks/dom"
import {
useAdminAcceptInvite,
useAdminCreateInvite,
useAdminDeleteInvite,
useAdminResendInvite,
} from "../../../../src/"
import { createWrapper } from "../../../utils"
describe("useAdminAcceptInvite hook", () => {
test("accepts an invite", async... |
3,752 | 0 | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin/invites/queries.test.ts | import { renderHook } from "@testing-library/react-hooks/dom"
import { fixtures } from "../../../../mocks/data"
import { useAdminInvites } from "../../../../src"
import { createWrapper } from "../../../utils"
describe("useAdminInvites hook", () => {
test("returns a list of invites", async () => {
const invites =... |
3,753 | 0 | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin/notes/mutations.test.ts | import { renderHook } from "@testing-library/react-hooks/dom"
import { fixtures } from "../../../../mocks/data"
import {
useAdminCreateNote,
useAdminDeleteNote,
useAdminUpdateNote,
} from "../../../../src/"
import { createWrapper } from "../../../utils"
describe("useAdminCreateNote hook", () => {
test("creates... |
3,754 | 0 | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin/notes/queries.test.ts | import { renderHook } from "@testing-library/react-hooks/dom"
import { fixtures } from "../../../../mocks/data"
import { useAdminNote, useAdminNotes } from "../../../../src"
import { createWrapper } from "../../../utils"
describe("useAdminNotes hook", () => {
test("returns a list of notes", async () => {
const n... |
3,755 | 0 | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin/notifications/mutations.test.ts | import { renderHook } from "@testing-library/react-hooks/dom"
import { fixtures } from "../../../../mocks/data"
import { useAdminResendNotification } from "../../../../src/"
import { createWrapper } from "../../../utils"
describe("useAdminResendNotification hook", () => {
test("resends a notification", async () => {... |
3,756 | 0 | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin | petrpan-code/medusajs/medusa/packages/medusa-react/test/hooks/admin/notifications/queries.test.ts | import { renderHook } from "@testing-library/react-hooks/dom"
import { fixtures } from "../../../../mocks/data"
import { useAdminNotifications } from "../../../../src"
import { createWrapper } from "../../../utils"
describe("useAdminNotifications hook", () => {
test("returns a list of notifications", async () => {
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.