diff --git a/tests/Feature/MailThemeTest.php b/tests/Feature/MailThemeTest.php index f7641a50..cc4dca63 100644 --- a/tests/Feature/MailThemeTest.php +++ b/tests/Feature/MailThemeTest.php @@ -86,6 +86,23 @@ function withPackageMailComponents(): void app()->forgetInstance(Markdown::class); } +it('stays on the standard contrast level, which is the one a mail client can show', function () { + File::put($this->temporary.'/material-scheme.json', json_encode([ + 'light' => ['primary' => '#123456', 'on-primary' => '#fefefe', 'surface-container' => '#eeeeee', 'surface-container-lowest' => '#fdfdfd'], + 'dark' => ['primary' => '#abcdef'], + 'contrast' => [ + 'standard' => 0, + 'high' => ['light' => ['primary' => '#000000', 'on-primary' => '#ffffff'], 'dark' => ['primary' => '#ffffff']], + ], + ])); + + config(['livewire-material.scheme' => $this->temporary.'/material-scheme.json']); + + expect(inlineStyle((new ThemedProbeMail)->render(), 'button-primary')) + ->toContain('background-color: #123456') + ->not->toContain('background-color: #000000'); +}); + it('inlines the application\'s scheme onto the mail', function () { File::put($this->temporary.'/material-scheme.json', json_encode([ 'light' => ['primary' => '#123456', 'on-primary' => '#fefefe', 'surface-container' => '#eeeeee', 'surface-container-lowest' => '#fdfdfd'],