test: fix relays in tests

broken by f121fe5981
in which default relays were reordered and additional hardcoded relays to write to relays were added
This commit is contained in:
DanConwayDev
2024-03-20 07:18:29 +00:00
parent c8a5b126d5
commit 1bfff65a2d

View File

@@ -228,8 +228,8 @@ describe('', () => {
expect.anything(), expect.anything(),
[ [
'wss://alicerelay.example.com', 'wss://alicerelay.example.com',
'wss://hist.nostr.land',
'wss://relay.damus.io', 'wss://relay.damus.io',
'wss://nostr-pub.wellorder.net',
], ],
expect.anything(), expect.anything(),
); );
@@ -249,7 +249,7 @@ describe('', () => {
[ [
'wss://alicerelay.example.com', 'wss://alicerelay.example.com',
'wss://expensive-relay.example2.com', 'wss://expensive-relay.example2.com',
'wss://relay.damus.io', 'wss://hist.nostr.land',
], ],
expect.anything(), expect.anything(),
); );
@@ -258,7 +258,7 @@ describe('', () => {
storeMyProfileEvent({ storeMyProfileEvent({
...SampleEvents.kind10002, ...SampleEvents.kind10002,
tags: [ tags: [
['r', 'wss://relay.damus.io'], ['r', 'wss://hist.nostr.land'],
['r', 'wss://expensive-relay.example2.com', 'write'], ['r', 'wss://expensive-relay.example2.com', 'write'],
], ],
}); });
@@ -267,9 +267,9 @@ describe('', () => {
expect.anything(), expect.anything(),
expect.anything(), expect.anything(),
[ [
'wss://relay.damus.io', 'wss://hist.nostr.land',
'wss://expensive-relay.example2.com', 'wss://expensive-relay.example2.com',
'wss://nostr-pub.wellorder.net', 'wss://relay.damus.io',
], ],
expect.anything(), expect.anything(),
); );
@@ -328,9 +328,9 @@ describe('', () => {
expect.anything(), expect.anything(),
expect.anything(), expect.anything(),
[ [
'wss://hist.nostr.land',
'wss://relay.damus.io', 'wss://relay.damus.io',
'wss://nostr-pub.wellorder.net', 'wss://nostr-pub.wellorder.net',
'wss://nostr-relay.wlvs.space',
], ],
expect.anything(), expect.anything(),
); );
@@ -380,8 +380,8 @@ describe('', () => {
expect.anything(), expect.anything(),
[ [
'wss://alicerelay.example.com', 'wss://alicerelay.example.com',
'wss://hist.nostr.land',
'wss://relay.damus.io', 'wss://relay.damus.io',
'wss://nostr-pub.wellorder.net',
], ],
expect.anything(), expect.anything(),
); );
@@ -397,15 +397,19 @@ describe('', () => {
mockPublishEventToRelay.mockReset() mockPublishEventToRelay.mockReset()
.mockImplementation(() => new Promise((r) => { r(true); })); .mockImplementation(() => new Promise((r) => { r(true); }));
}); });
test('publishEventToRelay is called with getRelays output + blastr', () => { test('publishEventToRelay is called with getRelays output + blastr and extra default write relays', () => {
FetchEvents.publishEvent(SampleEvents.kind0); FetchEvents.publishEvent(SampleEvents.kind0);
expect(mockPublishEventToRelay).toBeCalledWith( expect(mockPublishEventToRelay).toBeCalledWith(
SampleEvents.kind0, SampleEvents.kind0,
[ [
'wss://hist.nostr.land',
'wss://relay.damus.io', 'wss://relay.damus.io',
'wss://nostr-pub.wellorder.net', 'wss://nostr-pub.wellorder.net',
'wss://nostr-relay.wlvs.space',
'wss://nostr.mutinywallet.com', // blastr 'wss://nostr.mutinywallet.com', // blastr
'wss://purplepag.es',
'wss://relay.nos.social',
'wss://relay.nostr.band',
'wss://relay.snort.social',
], ],
); );
}); });