get(route('upload'))->assertOk()->assertSee('({"scheme":"indigo",', false); Setting::set('color_profile', 'graphite'); $this->get(route('upload'))->assertSee('({"scheme":"graphite",', false); $this->get('/s/does-not-exist')->assertNotFound()->assertSee('({"scheme":"graphite",', false); }); test('a saved profile that no longer exists falls back to the default', function () { Setting::set('color_profile', 'ocean'); expect(Scheme::profile())->toBe('indigo'); $this->get(route('upload'))->assertSee('({"scheme":"indigo",', false); }); test('mails take the saved colour profile', function () { Setting::set('color_profile', 'rose'); $html = (string) (new ResetPassword('token'))->toMail(User::factory()->create())->render(); expect($html)->toContain('background-color: '.Scheme::profiles()['rose']['light']['primary']) ->not->toContain('background-color: '.Scheme::profiles()['indigo']['light']['primary']); }); test('the stylesheet carries all eight profiles', function () { expect(array_keys(Scheme::profiles()))->toBe(['indigo', 'blue', 'teal', 'green', 'amber', 'rose', 'violet', 'graphite']) ->and(file_get_contents(resource_path('css/material-scheme.css')))->toContain("[data-scheme='graphite'][data-theme='dark']"); });