fix(compiler-sfc): transformAssetUrl should ignore inline data url (#1431)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import {
|
||||
isRelativeUrl,
|
||||
isExternalUrl
|
||||
isExternalUrl,
|
||||
isDataUrl
|
||||
} from '../../compiler-sfc/src/templateUtils'
|
||||
|
||||
describe('compiler sfc:templateUtils isRelativeUrl', () => {
|
||||
@@ -36,3 +37,17 @@ describe('compiler sfc:templateUtils isExternalUrl', () => {
|
||||
expect(result).toBe(true)
|
||||
})
|
||||
})
|
||||
|
||||
describe('compiler sfc:templateUtils isDataUrl', () => {
|
||||
test('should return true w/ hasn`t media type and encode', () => {
|
||||
expect(isDataUrl('data:,i')).toBe(true)
|
||||
})
|
||||
|
||||
test('should return true w/ media type + encode', () => {
|
||||
expect(isDataUrl('data:image/png;base64,i')).toBe(true)
|
||||
})
|
||||
|
||||
test('should return true w/ media type + hasn`t encode', () => {
|
||||
expect(isDataUrl('data:image/png,i')).toBe(true)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user