mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-15 10:14:21 +01:00
fix: PR comment and updated test case
on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
This commit is contained in:
@@ -161,7 +161,7 @@ describe('pie', () => {
|
|||||||
"rats" : 40.12
|
"rats" : 40.12
|
||||||
`);
|
`);
|
||||||
}).rejects.toThrowError(
|
}).rejects.toThrowError(
|
||||||
'"dogs" has invalid value: -60.67.Negative values are not allowed in pie charts. All slice values must be > 0'
|
'"dogs" has invalid value: -60.67. Negative values are not allowed in pie charts. All slice values must be >= 0.'
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ const clear = (): void => {
|
|||||||
const addSection = ({ label, value }: D3Section): void => {
|
const addSection = ({ label, value }: D3Section): void => {
|
||||||
if (value < 0) {
|
if (value < 0) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`"${label}" has invalid value: ${value}.Negative values are not allowed in pie charts. All slice values must be > 0.`
|
`"${label}" has invalid value: ${value}. Negative values are not allowed in pie charts. All slice values must be >= 0.`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (!sections.has(label)) {
|
if (!sections.has(label)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user