summaryrefslogtreecommitdiffstats
path: root/ui/src/api_tests/api.spec.ts
diff options
context:
space:
mode:
Diffstat (limited to 'ui/src/api_tests/api.spec.ts')
-rw-r--r--ui/src/api_tests/api.spec.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/ui/src/api_tests/api.spec.ts b/ui/src/api_tests/api.spec.ts
new file mode 100644
index 00000000..f6dfb161
--- /dev/null
+++ b/ui/src/api_tests/api.spec.ts
@@ -0,0 +1,13 @@
+import fetch from 'node-fetch';
+
+test('adds 1 + 2 to equal 3', () => {
+ let sum = (a: number, b: number) => a + b;
+ expect(sum(1, 2)).toBe(3);
+});
+
+test('Get communism.lemmy.ml nodeinfo href', async () => {
+ let url = 'https://communism.lemmy.ml/.well-known/nodeinfo';
+ let href = 'https://communism.lemmy.ml/nodeinfo/2.0.json';
+ let res = await fetch(url).then(d => d.json());
+ expect(res.links.href).toBe(href);
+});