fix the format and use window.location

This commit is contained in:
Yanzhen Yu
2026-04-01 12:00:00 +08:00
parent 4ed15164c9
commit 205d3b4aeb
2 changed files with 9 additions and 3 deletions

View File

@@ -48,8 +48,14 @@ describe('absolute url to stylesheet', () => {
});
it('can handle multiple no quote paths', () => {
expect(absoluteToStylesheet('background-image: url(images/b.jpg); background: #aabbcc url(images/a.jpg) 50% 50% repeat;', href)).to.equal(
`background-image: url('http://localhost/css/images/b.jpg'); background: #aabbcc url('http://localhost/css/images/a.jpg') 50% 50% repeat;`,
expect(
absoluteToStylesheet(
'background-image: url(images/b.jpg); background: #aabbcc url(images/a.jpg) 50% 50% repeat;',
href,
),
).to.equal(
`background-image: url('http://localhost/css/images/b.jpg');` +
`background: #aabbcc url('http://localhost/css/images/a.jpg') 50% 50% repeat;`,
);
});