test(style): add describe to cssDimensions test

This commit is contained in:
2026-07-28 19:38:02 +02:00
committed by Gitea
parent 1b7b7cbc68
commit a62d38cdb1
+5 -3
View File
@@ -14,10 +14,11 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { expect, test } from 'vitest'; import { describe, expect, test } from 'vitest';
import { ensureUnit } from '../cssDimensions'; import { ensureUnit } from '../cssDimensions';
test.for([ describe('cssDimensions', () => {
test.for([
{ dimension: null, expected: '0px' }, { dimension: null, expected: '0px' },
{ dimension: undefined, expected: '0px' }, { dimension: undefined, expected: '0px' },
@@ -117,6 +118,7 @@ test.for([
{ dimension: 'max(42px,5rem)', expected: 'max(42px,5rem)' }, { dimension: 'max(42px,5rem)', expected: 'max(42px,5rem)' },
{ dimension: 'clamp(42vh,23vw,13cap)', expected: 'clamp(42vh,23vw,13cap)' }, { dimension: 'clamp(42vh,23vw,13cap)', expected: 'clamp(42vh,23vw,13cap)' },
{ dimension: 'clamp( 42vh,23vw,13cap )', expected: 'clamp( 42vh,23vw,13cap )' } { dimension: 'clamp( 42vh,23vw,13cap )', expected: 'clamp( 42vh,23vw,13cap )' }
])('ensureUnit returns $expected with input $dimension', ({ dimension, expected }) => { ])('ensureUnit returns $expected with input $dimension', ({ dimension, expected }) => {
expect(ensureUnit(dimension)).toBe(expected); expect(ensureUnit(dimension)).toBe(expected);
});
}); });