Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbarnsley committed Nov 14, 2023
1 parent 1e101d8 commit 5e80a0d
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions tests/Feature/Http/Livewire/Home/ChartsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use App\Facades\Settings;
use App\Http\Livewire\Home\Chart;
use App\Services\Cache\NetworkCache;
use App\Services\Cache\NetworkStatusBlockCache;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Config;
Expand All @@ -25,17 +26,19 @@
Artisan::call('explorer:cache-currencies-history --no-delay');
Artisan::call('explorer:cache-prices');

(new NetworkStatusBlockCache())->setPrice('ARK', 'USD', 1.4);

(new NetworkCache())->setSupply(fn () => 456748578.342 * 1e8);

Livewire::test(Chart::class)
->set('period', 'day')
->assertSeeInOrder([
'ARK Price',
'$1.22',
'$1.40',
'USD',
'$1.22',
'$1.40',
'USD',
'[1.898,1.904,1.967,1.941,2.013,2.213,2.414,2.369,2.469,2.374,2.228,2.211,2.266,2.364,2.341,2.269,1.981,1.889,1.275,1.471,1.498,1.518,1.61,1.638]',
'[1.898,1.904,1.967,1.941,2.013,2.213,2.414,2.369,2.469,2.374,2.228,2.211,2.266,2.364,2.341,2.269,1.981,1.889,1.275,1.471,1.498,1.518,1.61,1.4]',
]);
});

Expand All @@ -53,12 +56,14 @@
Artisan::call('explorer:cache-currencies-history --no-delay');
Artisan::call('explorer:cache-prices');

(new NetworkStatusBlockCache())->setPrice('ARK', 'BTC', 15);

(new NetworkCache())->setSupply(fn () => 456748578.342 * 1e8);

Livewire::test(Chart::class)
->set('period', 'day')
->assertSee('0.00003363 BTC')
->assertSee('[1.898,1.904,1.967,1.941,2.013,2.213,2.414,2.369,2.469,2.374,2.228,2.211,2.266,2.364,2.341,2.269,1.981,1.889,1.275,1.471,1.498,1.518,1.61,1.638]');
->assertSee('15 BTC')
->assertSee('[1.898,1.904,1.967,1.941,2.013,2.213,2.414,2.369,2.469,2.374,2.228,2.211,2.266,2.364,2.341,2.269,1.981,1.889,1.275,1.471,1.498,1.518,1.61,15]');
});

it('should change the period', function ($period) {
Expand Down

0 comments on commit 5e80a0d

Please sign in to comment.