Skip to content

Commit

Permalink
Additional test for calling getScaleLabel on facts with no units.
Browse files Browse the repository at this point in the history
Closes Arelle#435
  • Loading branch information
Paul Warren committed Jun 29, 2023
1 parent 22a5654 commit 24ae91a
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions iXBRLViewerPlugin/viewer/src/js/fact.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,34 @@ describe("Readable accuracy", () => {
});
});

describe("Readable accuracy", () => {
test("With units", () => {
expect(testFact({
"v": "1234",
"d": 4,
"a": { "u": "iso4217:GBP" }
}).getScaleLabel(-2)).toBe("pence");
expect(testFact({
"v": "1234",
"d": 4,
"a": { "u": "iso4217:GBP" }
}).getScaleLabel(-4)).toBe(null);
});
test("Without units", () => {
expect(testFact({
"v": "1234",
"d": 4,
"a": {}
}).getScaleLabel(-2)).toBe("hundredths");
expect(testFact({
"v": "1234",
"d": 4,
"a": {}
}).getScaleLabel(-4)).toBe(null);
});
});


describe("Readable scale", () => {
test("Non-numeric", () => {
expect(testFact({
Expand Down

0 comments on commit 24ae91a

Please sign in to comment.