Skip to content

Commit f3c2a55

Browse files
authored
test(fix): bzz.link references (#82)
1 parent b2363ae commit f3c2a55

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

test/bzz-test-page/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ <h4>External image refer by BZZ protocol</h4>
3333
</div>
3434
<div>
3535
<h4>External image refer by bzz.link</h4>
36-
<img id="bzz-image-2" is="swarm-img" width="300" src="https://bafybwiec3z22ulsoe7xpypaa6xg4piwlpb2afedkonqjqa66b3rfmavu6u.bzz.link/images/jinn.png" />
36+
<img id="bzz-image-2" is="swarm-img" width="300" src="https://bah5qcgzaqlphlkrojyt657b4ad243r5czn4hiauqnjzwbgad3yhoevqcwt2q.bzz.link/images/jinn.png" />
3737
</div>
3838
<h2>Injected Swarm Script and Fake URL samples</h2>
3939
<div>

test/unit.spec.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@ describe('Unit', () => {
1313

1414
expect(fakeUrlAgain).toBe(fakeUrl)
1515
expect(sessionIdAgain).toBe(sessionId)
16+
17+
// with path
18+
const fakeUrl2 = `${FakeUrl.beeApiAddress}/bzz/${testBzzHash}/path/to/smth.img`
19+
const fakeUrlWithSessionId2 = `${fakeUrl2}__${SWARM_SESSION_ID_KEY}~${sessionId}__`
20+
const { originalUrl: fakeUrlAgain2, sessionId: sessionIdAgain2 } =
21+
unpackSwarmSessionIdFromUrl(fakeUrlWithSessionId2)
22+
23+
expect(fakeUrlAgain2).toBe(fakeUrl2)
24+
expect(sessionIdAgain2).toBe(sessionId)
1625
})
1726

1827
test('Throw error at Unpacking Swarm session ID from wrong URL', () => {

0 commit comments

Comments
 (0)