test: add more test cases with number & currency formatting
This commit is contained in:
parent
0568795edd
commit
2ddd808b58
2 changed files with 14 additions and 2 deletions
|
|
@ -47,6 +47,17 @@ context("Control Currency", () => {
|
|||
df_options: { precision: 0 },
|
||||
blur_expected: "10",
|
||||
},
|
||||
{
|
||||
input: "10.000",
|
||||
number_format: "#.###,##",
|
||||
df_options: { precision: 0 },
|
||||
blur_expected: "10.000",
|
||||
},
|
||||
{
|
||||
input: "10.000",
|
||||
number_format: "#.###,##",
|
||||
blur_expected: "10.000,00",
|
||||
},
|
||||
{
|
||||
input: "10.101",
|
||||
df_options: { precision: "" },
|
||||
|
|
@ -61,6 +72,7 @@ context("Control Currency", () => {
|
|||
.then((frappe) => {
|
||||
frappe.boot.sysdefaults.currency = test_case.currency;
|
||||
frappe.boot.sysdefaults.currency_precision = test_case.default_precision ?? 2;
|
||||
frappe.boot.sysdefaults.number_format = test_case.number_format ?? "#,###.##";
|
||||
});
|
||||
|
||||
get_dialog_with_currency(test_case.df_options).as("dialog");
|
||||
|
|
|
|||
|
|
@ -89,13 +89,13 @@ context("Control Float", () => {
|
|||
values: [
|
||||
{
|
||||
input: "12.345",
|
||||
blur_expected: "12.345",
|
||||
blur_expected: "12.345,000",
|
||||
focus_expected: "12345",
|
||||
},
|
||||
{
|
||||
// parseFloat would reduce 12,340 to 12,34 if this string was ever to be parsed
|
||||
input: "12.340",
|
||||
blur_expected: "12.340",
|
||||
blur_expected: "12.340,000",
|
||||
focus_expected: "12340",
|
||||
},
|
||||
],
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue