2025-11-05 17:04:23 -03:00

22 lines
553 B
JavaScript

import JID from "../lib/JID.js";
test('should serialize a "domain" JID', () => {
const j = new JID(null, "d");
expect(j.toString()).toBe("d");
});
test('should serialize a "user@domain" JID', () => {
const j = new JID("u", "d");
expect(j.toString()).toBe("u@d");
});
test('should serialize a "domain/resource" JID', () => {
const j = new JID(null, "d", "r");
expect(j.toString()).toBe("d/r");
});
test('should serialize a "user@domain/resource" JID', () => {
const j = new JID("u", "d", "r");
expect(j.toString()).toBe("u@d/r");
});