| 1 |
/** @odoo-module */ |
| 2 |
|
| 3 |
import { describe, expect, test } from "@odoo/hoot"; |
| 4 |
import { parseUrl } from "../local_helpers"; |
| 5 |
|
| 6 |
import { Suite } from "../../core/suite"; |
| 7 |
|
| 8 |
describe(parseUrl(import.meta.url), () => { |
| 9 |
test("should have a hashed id", () => { |
| 10 |
expect(new Suite(null, "a suite", []).id).toMatch(/^\w{8}$/); |
| 11 |
}); |
| 12 |
|
| 13 |
test("should describe its path in its name", () => { |
| 14 |
const a = new Suite(null, "a", []); |
| 15 |
const b = new Suite(a, "b", []); |
| 16 |
const c = new Suite(a, "c", []); |
| 17 |
const d = new Suite(b, "d", []); |
| 18 |
|
| 19 |
expect(a.parent).toBe(null); |
| 20 |
expect(b.parent).toBe(a); |
| 21 |
expect(c.parent).toBe(a); |
| 22 |
expect(d.parent.parent).toBe(a); |
| 23 |
|
| 24 |
expect(a.fullName).toBe("a"); |
| 25 |
expect(b.fullName).toBe("a/b"); |
| 26 |
expect(c.fullName).toBe("a/c"); |
| 27 |
expect(d.fullName).toBe("a/b/d"); |
| 28 |
}); |
| 29 |
}); |