mirror of
https://github.com/material-components/material-web.git
synced 2026-03-09 00:09:23 +08:00
In particular, this allows external build tools like Rollup and @web/dev-server to understand imports of Lit, which is configured to require the ".js" extension via its export conditions (so that Lit import maps can remain minimal). PiperOrigin-RevId: 469772992
33 lines
878 B
TypeScript
33 lines
878 B
TypeScript
/**
|
|
* @license
|
|
* Copyright 2022 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import 'jasmine';
|
|
|
|
import {stringConverter} from './string-converter.js';
|
|
|
|
describe('stringConverter', () => {
|
|
describe('.fromAttribute', () => {
|
|
it('should return an empty string if string is empty or null', () => {
|
|
expect(stringConverter.fromAttribute('')).toBe('');
|
|
expect(stringConverter.fromAttribute(null)).toBe('');
|
|
});
|
|
|
|
it('should return value of string if not empty', () => {
|
|
expect(stringConverter.fromAttribute('foo')).toBe('foo');
|
|
});
|
|
});
|
|
|
|
describe('.toAttribute', () => {
|
|
it('should return null if string is empty', () => {
|
|
expect(stringConverter.toAttribute('')).toBeNull();
|
|
});
|
|
|
|
it('should return value of string if not empty', () => {
|
|
expect(stringConverter.toAttribute('foo')).toBe('foo');
|
|
});
|
|
});
|
|
});
|