FIX: Slightly better behaviour for increase/decrease decimal places
The general solution must be done in Rust and it is a bit more complex.
This commit is contained in:
committed by
Nicolás Hatcher Andrés
parent
f78027247b
commit
75d8a5282e
@@ -1,7 +1,26 @@
|
||||
import { expect, test } from "vitest";
|
||||
import { decreaseDecimalPlaces, increaseDecimalPlaces } from "../formatUtil";
|
||||
import { isNavigationKey } from "../util";
|
||||
|
||||
test("checks arrow left is a navigation key", () => {
|
||||
expect(isNavigationKey("ArrowLeft")).toBe(true);
|
||||
expect(isNavigationKey("Arrow")).toBe(false);
|
||||
});
|
||||
|
||||
test("increase decimals", () => {
|
||||
expect(increaseDecimalPlaces('"€"#,##0.00'), '"€"#,##0.000');
|
||||
expect(increaseDecimalPlaces("general"), "#,##0.000");
|
||||
expect(
|
||||
increaseDecimalPlaces('dddd"," mmmm dd"," yyyy'),
|
||||
'dddd"," mmmm dd"," yyyy',
|
||||
);
|
||||
});
|
||||
|
||||
test("decrease decimals", () => {
|
||||
expect(decreaseDecimalPlaces('"€"#,##0.00'), '"€"#,##0.0');
|
||||
expect(decreaseDecimalPlaces("general"), "#,##0.0");
|
||||
expect(
|
||||
decreaseDecimalPlaces('dddd"," mmmm dd"," yyyy'),
|
||||
'dddd"," mmmm dd"," yyyy',
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user