mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-29 18:20:01 +00:00
The net worth chart will respect net worth preferences.
This commit is contained in:
@@ -113,6 +113,48 @@ class ChartJsGeneratorTest extends TestCase
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Generator\Chart\Basic\ChartJsGenerator
|
||||
*/
|
||||
public function testMultiCurrencyPieChart(): void
|
||||
{
|
||||
|
||||
$data = [
|
||||
'one' => ['amount' => -1,'currency_symbol' => 'a'],
|
||||
'two' => ['amount' => -2,'currency_symbol' => 'b'],
|
||||
'three' => ['amount' => -3,'currency_symbol' => 'c'],
|
||||
];
|
||||
|
||||
/** @var ChartJsGenerator $generator */
|
||||
$generator = new ChartJsGenerator();
|
||||
$result = $generator->multiCurrencyPieChart($data);
|
||||
|
||||
$this->assertEquals('three', $result['labels'][0]);
|
||||
$this->assertEquals(3.0, $result['datasets'][0]['data'][0]);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Generator\Chart\Basic\ChartJsGenerator
|
||||
*/
|
||||
public function testMultiCurrencyPieChartPositive(): void
|
||||
{
|
||||
|
||||
$data = [
|
||||
'one' => ['amount' => 1,'currency_symbol' => 'a'],
|
||||
'two' => ['amount' => 2,'currency_symbol' => 'b'],
|
||||
'three' => ['amount' => 3,'currency_symbol' => 'c'],
|
||||
];
|
||||
|
||||
/** @var ChartJsGenerator $generator */
|
||||
$generator = new ChartJsGenerator();
|
||||
$result = $generator->multiCurrencyPieChart($data);
|
||||
|
||||
$this->assertEquals('three', $result['labels'][0]);
|
||||
$this->assertEquals(3.0, $result['datasets'][0]['data'][0]);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Generator\Chart\Basic\ChartJsGenerator
|
||||
*/
|
||||
|
Reference in New Issue
Block a user