diff --git a/packages/sdk/__tests__/dom.spec.ts b/packages/sdk/__tests__/dom.spec.ts index 729991f75e8..57543cacf14 100644 --- a/packages/sdk/__tests__/dom.spec.ts +++ b/packages/sdk/__tests__/dom.spec.ts @@ -175,7 +175,7 @@ describe('createLink', () => { expect(needAttach).toBe(true); }); - xit('should reuse an existing link element if one exists', () => { + it('should reuse an existing link element if one exists', () => { const url = 'https://example.com/script.js'; const cb = jest.fn(); document.head.innerHTML = ``; diff --git a/packages/sdk/src/dom.ts b/packages/sdk/src/dom.ts index 8a3c7ad43f8..ac678cf0328 100644 --- a/packages/sdk/src/dom.ts +++ b/packages/sdk/src/dom.ts @@ -155,11 +155,11 @@ export function createLink(info: { for (let i = 0; i < links.length; i++) { const l = links[i]; const linkHref = l.getAttribute('href'); - const linkRef = l.getAttribute('ref'); + const linkRel = l.getAttribute('rel'); if ( linkHref && isStaticResourcesEqual(linkHref, info.url) && - linkRef === info.attrs['ref'] + linkRel === info.attrs['rel'] ) { link = l; needAttach = false;