Skip to content

Commit

Permalink
fixing rules tests
Browse files Browse the repository at this point in the history
  • Loading branch information
markhuot committed Oct 25, 2023
1 parent 830f860 commit 5bf4b29
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/attributes/SpaceBetweenAttributeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,19 @@
$rules = \Craft::$app->getView()->getCssRules();

expect($classNames['class'])->not->toBeEmpty();
expect((string) $rules)->toBe('<style>.c0 > * + *{margin-top:1rem}</style>');
expect(current($rules))
->property->toBe('margin-top')
->value->toBe('1rem')
->selector->toBe('& > * + *');
});

it('renders margin-left', function () {
$classNames = (new SpaceBetween(['x' => '1rem']))->toAttributeArray();
$rules = \Craft::$app->getView()->getCssRules();

expect($classNames['class'])->not->toBeEmpty();
expect((string) $rules)->toBe('<style>.c0 > * + *{margin-left:1rem}</style>');
expect(current($rules))
->property->toBe('margin-left')
->value->toBe('1rem')
->selector->toBe('& > * + *');
});

0 comments on commit 5bf4b29

Please sign in to comment.