Laravel Dusk Select CSS Variable

530 Views Asked by At

I'm writing a browser test for my dark-theme. I'm trying to test that when the checkbox is checked, the variable var(--bg-color) is #3a3c3b. Now when I run this test it always succeeds even if I put some random stuff in the assert value.

    public function DarkTheme()
    {
        $this->browse(function (Browser $browser) {
            $browser->visit('/')
                ->check('.theme-switch input[type="checkbox"]')
                ->assertAttribute('', 'var(--bg-color)', '#3a3c3b');
        });
    }
0

There are 0 best solutions below