Skip to content

Commit

Permalink
test: update ADDED-CID message format expectation to match JSON format
Browse files Browse the repository at this point in the history
Co-Authored-By: Nico Krause <[email protected]>
  • Loading branch information
devin-ai-integration[bot] and silkroadnomad committed Dec 21, 2024
1 parent 1ab4c0c commit 214d404
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions relay/tests/relay.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,16 @@ describe('Doichain Relay Pinning Service Test', function() {
const decimalPlaces = response.fee.amount.toString().split('.')[1]?.length || 0;
expect(decimalPlaces).to.be.at.most(8, 'Fee should have at most 8 decimal places');

// Check the plain text ADDED-CID message
expect(messages).to.include(`ADDED-CID:${cid}`);
// Check for the ADDED-CID JSON message
const addedMessage = messages.find(msg => {
try {
const parsed = JSON.parse(msg);
return parsed.status === "ADDED-CID" && parsed.cid === cid.toString();
} catch (e) {
return false;
}
});
expect(addedMessage).to.exist;

// Verify the retrieved content matches our metadata
let retrievedContent = '';
Expand Down

0 comments on commit 214d404

Please sign in to comment.