Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sitecore-jss] Fix FEAAS stylesheet issue #1651

Merged
merged 2 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions packages/sitecore-jss/src/feaas/themes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('themes', () => {
},
})
)
).to.deep.equal([{ href: getStylesheetUrl('foo'), rel: 'style' }]);
).to.deep.equal([{ href: getStylesheetUrl('foo'), rel: 'stylesheet' }]);
});

it('should return links using LibraryId field', () => {
Expand All @@ -72,7 +72,7 @@ describe('themes', () => {
},
})
)
).to.deep.equal([{ href: getStylesheetUrl('bar'), rel: 'style' }]);
).to.deep.equal([{ href: getStylesheetUrl('bar'), rel: 'stylesheet' }]);
});

it('should return links using CSSStyles param', () => {
Expand All @@ -85,7 +85,7 @@ describe('themes', () => {
},
})
)
).to.deep.equal([{ href: getStylesheetUrl('foo'), rel: 'style' }]);
).to.deep.equal([{ href: getStylesheetUrl('foo'), rel: 'stylesheet' }]);
});

it('should return links using LibraryId param', () => {
Expand All @@ -98,7 +98,7 @@ describe('themes', () => {
},
})
)
).to.deep.equal([{ href: getStylesheetUrl('bar'), rel: 'style' }]);
).to.deep.equal([{ href: getStylesheetUrl('bar'), rel: 'stylesheet' }]);
});

it('should return prefer params over fields', () => {
Expand All @@ -116,7 +116,7 @@ describe('themes', () => {
},
})
)
).to.deep.equal([{ href: getStylesheetUrl('foo'), rel: 'style' }]);
).to.deep.equal([{ href: getStylesheetUrl('foo'), rel: 'stylesheet' }]);

expect(
getFEAASLibraryStylesheetLinks(
Expand All @@ -132,7 +132,7 @@ describe('themes', () => {
},
})
)
).to.deep.equal([{ href: getStylesheetUrl('bar'), rel: 'style' }]);
).to.deep.equal([{ href: getStylesheetUrl('bar'), rel: 'stylesheet' }]);
});

it('should read LibraryId from class when matching param or field is not found', () => {
Expand All @@ -157,7 +157,7 @@ describe('themes', () => {
},
})
)
).to.deep.equal([{ href: getStylesheetUrl('foo'), rel: 'style' }]);
).to.deep.equal([{ href: getStylesheetUrl('foo'), rel: 'stylesheet' }]);
});

it('should return links using non-prod server url', () => {
Expand All @@ -180,7 +180,7 @@ describe('themes', () => {
LayoutServicePageState.Normal,
'https://edge-platform-dev.sitecorecloud.io'
),
rel: 'style',
rel: 'stylesheet',
},
]);
});
Expand Down Expand Up @@ -330,7 +330,7 @@ describe('themes', () => {
).to.deep.equal(
['foo', 'x11', 'x12', 'x21', 'y1', 'y2', 'z1', 'z11', 'z21'].map((id) => ({
href: getStylesheetUrl(id),
rel: 'style',
rel: 'stylesheet',
}))
);
});
Expand All @@ -352,7 +352,7 @@ describe('themes', () => {
)
)
).to.deep.equal([
{ href: getStylesheetUrl('bar', LayoutServicePageState.Edit), rel: 'style' },
{ href: getStylesheetUrl('bar', LayoutServicePageState.Edit), rel: 'stylesheet' },
]);
});

Expand All @@ -373,7 +373,7 @@ describe('themes', () => {
)
).to.deep.equal([
{
rel: 'style',
rel: 'stylesheet',
href: getStylesheetUrl(
'bar',
LayoutServicePageState.Edit,
Expand Down Expand Up @@ -457,7 +457,7 @@ describe('themes', () => {
})
).to.deep.equal(
['x1', 'y1', 'z1', 'z2'].map((id) => ({
rel: 'style',
rel: 'stylesheet',
href: getStylesheetUrl(id, LayoutServicePageState.Edit),
}))
);
Expand Down
2 changes: 1 addition & 1 deletion packages/sitecore-jss/src/feaas/themes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function getFEAASLibraryStylesheetLinks(

return [...ids].map((id) => ({
href: getStylesheetUrl(id, layoutData.sitecore.context.pageState, sitecoreEdgeUrl),
rel: 'style',
rel: 'stylesheet',
}));
}

Expand Down