Skip to content

Commit fb07664

Browse files
committed
Add blank node system test.
Closes #34
1 parent 7ce5077 commit fb07664

2 files changed

Lines changed: 169 additions & 0 deletions

File tree

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
{
2+
"log": {
3+
"_recordingName": "System test: blank nodes/Alice's friends with one expression",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "4.1.0"
8+
},
9+
"entries": [
10+
{
11+
"_id": "e0158368a4527e1173c6c7e213eec436",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 0,
16+
"cookies": [],
17+
"headers": [
18+
{
19+
"_fromType": "array",
20+
"name": "accept",
21+
"value": "application/n-quads,application/trig;q=0.95,application/ld+json;q=0.9,application/n-triples;q=0.8,text/turtle;q=0.5,application/rdf+xml;q=0.5,application/json;q=0.45,text/n3;q=0.35,application/xml;q=0.3,text/xml;q=0.3,image/svg+xml;q=0.3,text/html;q=0.2,application/xhtml+xml;q=0.18"
22+
},
23+
{
24+
"_fromType": "array",
25+
"name": "accept-encoding",
26+
"value": "gzip,deflate"
27+
},
28+
{
29+
"_fromType": "array",
30+
"name": "user-agent",
31+
"value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"
32+
},
33+
{
34+
"_fromType": "array",
35+
"name": "connection",
36+
"value": "close"
37+
},
38+
{
39+
"name": "host",
40+
"value": "drive.verborgh.org"
41+
}
42+
],
43+
"headersSize": 502,
44+
"httpVersion": "HTTP/1.1",
45+
"method": "GET",
46+
"queryString": [],
47+
"url": "https://drive.verborgh.org/public/2019/blanks.ttl"
48+
},
49+
"response": {
50+
"bodySize": 334,
51+
"content": {
52+
"mimeType": "text/turtle",
53+
"size": 334,
54+
"text": "[\"1f8b08000000000000037328284a4dcbac5048cb4f4cb352b0c9282929b0d2d7afc8cdc92bd64bcecfd50789eb1be819eadbe97171d9283be66426a7da4154e725e6a62a28814594acb91460006c52765e7e79b14234b242a7fc242585581d84429806208da2d039b1283f07a81461a111a68d46c85642ac81d869a30cb4c8c80ebb3d0a36ca60d38d80be812a4473a291124806aa08590e22a4a40700ff2c320531010000\"]"
55+
},
56+
"cookies": [],
57+
"headers": [
58+
{
59+
"name": "date",
60+
"value": "Sat, 25 Apr 2020 21:45:20 GMT"
61+
},
62+
{
63+
"name": "content-type",
64+
"value": "text/turtle"
65+
},
66+
{
67+
"name": "transfer-encoding",
68+
"value": "chunked"
69+
},
70+
{
71+
"name": "connection",
72+
"value": "close"
73+
},
74+
{
75+
"name": "vary",
76+
"value": "Accept-Encoding, Accept, Authorization, Origin"
77+
},
78+
{
79+
"name": "x-powered-by",
80+
"value": "solid-server"
81+
},
82+
{
83+
"name": "access-control-allow-credentials",
84+
"value": "true"
85+
},
86+
{
87+
"name": "access-control-expose-headers",
88+
"value": "Authorization, User, Location, Link, Vary, Last-Modified, ETag, Accept-Patch, Accept-Post, Updates-Via, Allow, WAC-Allow, Content-Length, WWW-Authenticate"
89+
},
90+
{
91+
"name": "allow",
92+
"value": "OPTIONS, HEAD, GET, PATCH, POST, PUT, DELETE"
93+
},
94+
{
95+
"name": "link",
96+
"value": "<blanks.ttl.acl>; rel=\"acl\", <blanks.ttl.meta>; rel=\"describedBy\", <http://www.w3.org/ns/ldp#Resource>; rel=\"type\""
97+
},
98+
{
99+
"name": "wac-allow",
100+
"value": "user=\"read\",public=\"read\""
101+
},
102+
{
103+
"name": "ms-author-via",
104+
"value": "SPARQL"
105+
},
106+
{
107+
"name": "updates-via",
108+
"value": "wss://drive.verborgh.org"
109+
},
110+
{
111+
"name": "strict-transport-security",
112+
"value": "max-age=15768000"
113+
},
114+
{
115+
"name": "content-encoding",
116+
"value": "gzip"
117+
}
118+
],
119+
"headersSize": 766,
120+
"httpVersion": "HTTP/1.1",
121+
"redirectURL": "",
122+
"status": 200,
123+
"statusText": "OK"
124+
},
125+
"startedDateTime": "2020-04-25T21:45:20.680Z",
126+
"time": 226,
127+
"timings": {
128+
"blocked": -1,
129+
"connect": -1,
130+
"dns": -1,
131+
"receive": 0,
132+
"send": 0,
133+
"ssl": -1,
134+
"wait": 226
135+
}
136+
}
137+
],
138+
"pages": [],
139+
"version": "1.2"
140+
}
141+
}

test/system/blanks-test.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import data from '../../src/exports/comunica.js';
2+
3+
jest.unmock('solid-auth-client');
4+
import { mockHttp } from '../util';
5+
6+
const alice = 'https://drive.verborgh.org/public/2019/blanks.ttl#Alice';
7+
8+
describe('System test: blank nodes', () => {
9+
mockHttp();
10+
11+
test('Alice\'s friends with one expression', async () => {
12+
const names = [];
13+
for await (const name of data[alice].friends.name)
14+
names.push(`${name}`);
15+
expect(names).toHaveLength(2);
16+
expect(names).toContain('Bob');
17+
expect(names).toContain('Carol');
18+
});
19+
20+
test('Alice\'s friends with two expressions', async () => {
21+
const names = [];
22+
for await (const friend of data[alice].friends)
23+
names.push(`${await friend.name}`);
24+
expect(names).toHaveLength(2);
25+
expect(names).toContain('Bob');
26+
expect(names).toContain('Carol');
27+
});
28+
});

0 commit comments

Comments
 (0)