Skip to content

Commit a054304

Browse files
committed
Add test for loading saved result with non-ASCII From header
1 parent e924947 commit a054304

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

test/unittest/authVerifierSpec.mjs.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,33 @@ describe("AuthVerifier [unittest]", function () {
323323
expect(res.dkim[0]?.favicon).to.be.a("string").and.satisfy(
324324
(/** @type {string} */ favicon) => favicon.startsWith("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiICBzdGFuZGFsb25l"));
325325
});
326+
327+
it("loading SavedAuthResult 3.1 with non-ASCII From header", async function () {
328+
storedData = {
329+
version: "3.1",
330+
dkim: [
331+
{
332+
version: "2.0",
333+
result: "SUCCESS",
334+
sdid: "fastmail.com",
335+
auid: "@fastmail.com",
336+
selector: "brisbane",
337+
warnings: [],
338+
keySecure: false,
339+
},
340+
],
341+
spf: [],
342+
dmarc: [],
343+
};
344+
345+
const header = new FakeMessageHeader();
346+
header.author = "⚡Fastmail⚡ <[email protected]>";
347+
348+
const res = await authVerifier.verify(header);
349+
expect(res.dkim[0]?.res_num).to.be.equal(10);
350+
expect(res.dkim[0]?.result).to.be.equal("SUCCESS");
351+
expect(res.dkim[0]?.favicon).to.be.equal("moz-extension://fake/data/favicon/fastmail.com.webp");
352+
});
326353
});
327354

328355
describe("sign rules", function () {

0 commit comments

Comments
 (0)