Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

Commit

Permalink
Update remote attachment testing endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
rygine committed Jan 20, 2024
1 parent 72fd1c9 commit fba0cc0
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ test("can create a remote attachment", async () => {
);

try {
await fetch("https://localhost/test", {
await fetch("https://localhost:3000/test", {
method: "POST",
body: encryptedEncodedContent.payload,
headers: {
Expand All @@ -57,7 +57,7 @@ test("can create a remote attachment", async () => {
}

const remoteAttachment: RemoteAttachment = {
url: "https://localhost/test",
url: "https://localhost:3000/test",
contentDigest: encryptedEncodedContent.digest,
salt: encryptedEncodedContent.salt,
nonce: encryptedEncodedContent.nonce,
Expand All @@ -80,8 +80,9 @@ test("can create a remote attachment", async () => {

const message = messages[0];
const messageContent = message.content as RemoteAttachment;
expect(messageContent.url).toBe("https://localhost/test");
expect(messageContent.url).toBe("https://localhost:3000/test");
expect(messageContent.filename).toBe("test.txt");
expect(messageContent.contentDigest).toBe(encryptedEncodedContent.digest);

const content: Attachment = await RemoteAttachmentCodec.load(
messageContent,
Expand Down Expand Up @@ -169,7 +170,7 @@ test("fails if content digest does not match", async () => {
);

try {
await fetch("https://localhost/test", {
await fetch("https://localhost:3000/test", {
method: "POST",
body: encryptedEncodedContent.payload,
headers: {
Expand All @@ -181,7 +182,7 @@ test("fails if content digest does not match", async () => {
}

const remoteAttachment: RemoteAttachment = {
url: "https://localhost/test",
url: "https://localhost:3000/test",
contentDigest: encryptedEncodedContent.digest,
salt: encryptedEncodedContent.salt,
nonce: encryptedEncodedContent.nonce,
Expand All @@ -205,7 +206,7 @@ test("fails if content digest does not match", async () => {
attachment,
new AttachmentCodec(),
);
await fetch("https://localhost/test", {
await fetch("https://localhost:3000/test", {
method: "POST",
body: encryptedEncoded2.payload,
headers: {
Expand Down

0 comments on commit fba0cc0

Please sign in to comment.