2022-06-02 10:00:09 +08:00
|
|
|
import '../../src';
|
2022-02-15 16:23:46 +08:00
|
|
|
|
2022-06-02 10:00:09 +08:00
|
|
|
import {buildStyle} from '../../src';
|
2022-02-15 16:23:46 +08:00
|
|
|
|
|
|
|
test('style var background', () => {
|
|
|
|
expect(
|
|
|
|
buildStyle('${style}', {
|
|
|
|
style: {
|
|
|
|
backgroundImage: 'http://www.example.com/a.png'
|
|
|
|
}
|
|
|
|
})
|
|
|
|
).toEqual({
|
|
|
|
backgroundImage: 'url("http://www.example.com/a.png")'
|
|
|
|
});
|
|
|
|
|
|
|
|
expect(
|
|
|
|
buildStyle(
|
|
|
|
{
|
|
|
|
backgroundImage: 'http://www.example.com/a.png'
|
|
|
|
},
|
|
|
|
{}
|
|
|
|
)
|
|
|
|
).toEqual({
|
|
|
|
backgroundImage: 'url("http://www.example.com/a.png")'
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
test('style case', () => {
|
|
|
|
expect(
|
|
|
|
buildStyle(
|
|
|
|
{
|
|
|
|
'font-size': '10'
|
|
|
|
},
|
|
|
|
{}
|
|
|
|
)
|
|
|
|
).toEqual({
|
|
|
|
fontSize: '10'
|
|
|
|
});
|
|
|
|
});
|