Skip to content

Commit

Permalink
fix: update dns test case
Browse files Browse the repository at this point in the history
  • Loading branch information
isaackps committed Jan 24, 2024
1 parent b15d2a3 commit 28f0d29
Show file tree
Hide file tree
Showing 2 changed files with 222 additions and 19 deletions.
219 changes: 219 additions & 0 deletions src/commands/dns/txt-record/__test__/__snapshots__/get.test.ts.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`get should return dns-txt 1`] = `
[MockFunction] {
"calls": Array [
Array [
Array [
Object {
"addr": "0x1550DD7B63a52356194aBBe5dfeCDe3f322FF335",
"dnssec": true,
"net": "ethereum",
"netId": "1",
"type": "openatts",
},
Object {
"addr": "0x2f45d8c2b55C935d3b9fBD41fCd9ABF790d5FA25",
"dnssec": true,
"net": "ethereum",
"netId": "1",
"type": "openatts",
},
Object {
"addr": "0x5FACf3cbd08AA4511Ff38D6DE64ee01A56272bBd",
"dnssec": true,
"net": "ethereum",
"netId": "1",
"type": "openatts",
},
Object {
"addr": "0x7Ae2aE35f66ACE6671CB2bfb985011b0a2d9cf72",
"dnssec": true,
"net": "ethereum",
"netId": "137",
"type": "openatts",
},
Object {
"addr": "0xFF36D7105715641Ca98A62a6890F86d00bBD5C25",
"dnssec": true,
"net": "ethereum",
"netId": "137",
"type": "openatts",
},
Object {
"addr": "0x48399Fb88bcD031C556F53e93F690EEC07963Af3",
"dnssec": true,
"net": "ethereum",
"netId": "3",
"type": "openatts",
},
Object {
"addr": "0x96897ba6884543bFEe6b082777E3475633165C9F",
"dnssec": true,
"net": "ethereum",
"netId": "3",
"type": "openatts",
},
Object {
"addr": "0x9db35C07350e9a16C828dAda37fd9c2923c75812",
"dnssec": true,
"net": "ethereum",
"netId": "3",
"type": "openatts",
},
Object {
"addr": "0xCD2dcF53B001b3998FFF7a3A13CB74bbaB27723A",
"dnssec": true,
"net": "ethereum",
"netId": "3",
"type": "openatts",
},
Object {
"addr": "0xdA8DBd2Aaffc995F11314c0040716E791de5aEd2",
"dnssec": true,
"net": "ethereum",
"netId": "3",
"type": "openatts",
},
],
],
Array [
Array [
Object {
"algorithm": "dns-did",
"dnssec": true,
"publicKey": "did:ethr:0x2f45d8c2b55C935d3b9fBD41fCd9ABF790d5FA25#controller",
"type": "openatts",
"version": "1.0",
},
Object {
"algorithm": "dns-did",
"dnssec": true,
"publicKey": "did:ethr:0xDC674219c4057d7795d9dA3d6AB3d301BF16355D#controller",
"type": "openatts",
"version": "1.0",
},
],
],
],
"results": Array [
Object {
"type": "return",
"value": undefined,
},
Object {
"type": "return",
"value": undefined,
},
],
}
`;

exports[`get should return dns-txt 2`] = `
[MockFunction] {
"calls": Array [
Array [
Array [
Object {
"addr": "0x1550DD7B63a52356194aBBe5dfeCDe3f322FF335",
"dnssec": true,
"net": "ethereum",
"netId": "1",
"type": "openatts",
},
Object {
"addr": "0x2f45d8c2b55C935d3b9fBD41fCd9ABF790d5FA25",
"dnssec": true,
"net": "ethereum",
"netId": "1",
"type": "openatts",
},
Object {
"addr": "0x5FACf3cbd08AA4511Ff38D6DE64ee01A56272bBd",
"dnssec": true,
"net": "ethereum",
"netId": "1",
"type": "openatts",
},
Object {
"addr": "0x7Ae2aE35f66ACE6671CB2bfb985011b0a2d9cf72",
"dnssec": true,
"net": "ethereum",
"netId": "137",
"type": "openatts",
},
Object {
"addr": "0xFF36D7105715641Ca98A62a6890F86d00bBD5C25",
"dnssec": true,
"net": "ethereum",
"netId": "137",
"type": "openatts",
},
Object {
"addr": "0x48399Fb88bcD031C556F53e93F690EEC07963Af3",
"dnssec": true,
"net": "ethereum",
"netId": "3",
"type": "openatts",
},
Object {
"addr": "0x96897ba6884543bFEe6b082777E3475633165C9F",
"dnssec": true,
"net": "ethereum",
"netId": "3",
"type": "openatts",
},
Object {
"addr": "0x9db35C07350e9a16C828dAda37fd9c2923c75812",
"dnssec": true,
"net": "ethereum",
"netId": "3",
"type": "openatts",
},
Object {
"addr": "0xCD2dcF53B001b3998FFF7a3A13CB74bbaB27723A",
"dnssec": true,
"net": "ethereum",
"netId": "3",
"type": "openatts",
},
Object {
"addr": "0xdA8DBd2Aaffc995F11314c0040716E791de5aEd2",
"dnssec": true,
"net": "ethereum",
"netId": "3",
"type": "openatts",
},
],
],
Array [
Array [
Object {
"algorithm": "dns-did",
"dnssec": true,
"publicKey": "did:ethr:0x2f45d8c2b55C935d3b9fBD41fCd9ABF790d5FA25#controller",
"type": "openatts",
"version": "1.0",
},
Object {
"algorithm": "dns-did",
"dnssec": true,
"publicKey": "did:ethr:0xDC674219c4057d7795d9dA3d6AB3d301BF16355D#controller",
"type": "openatts",
"version": "1.0",
},
],
],
],
"results": Array [
Object {
"type": "return",
"value": undefined,
},
Object {
"type": "return",
"value": undefined,
},
],
}
`;
22 changes: 3 additions & 19 deletions src/commands/dns/txt-record/__test__/get.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,10 @@ describe("get", () => {
});
it("should return dns-txt", async () => {
const consoleSpy = jest.spyOn(console, "table");
await handler({ location: "donotuse.openattestation.com" });
await handler({ location: "tradetrust.io" });
// dns-txt
expect(consoleSpy).toHaveBeenNthCalledWith(1, [
{
addr: "0x2f60375e8144e16Adf1979936301D8341D58C36C",
dnssec: true,
net: "ethereum",
netId: "3",
type: "openatts",
},
]);
expect(consoleSpy).toMatchSnapshot();
// dns-did
expect(consoleSpy).toHaveBeenNthCalledWith(2, [
{
algorithm: "dns-did",
dnssec: true,
publicKey: "did:ethr:0xE712878f6E8d5d4F9e87E10DA604F9cB564C9a89#controller",
type: "openatts",
version: "1.0",
},
]);
expect(consoleSpy).toMatchSnapshot();
});
});

0 comments on commit 28f0d29

Please sign in to comment.