mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 13:03:39 +08:00
DEV: Fix settings/interface UI breaking on Ember CLI (#12154)
Fixes failures in user-preferences-interface-test on Ember CLI. Included: * DEV: User themes have `theme_id` not `id` * FIX: `themeId` could point to a non-existent theme * DEV: Add request stub Co-authored-by: Penar Musaraj <pmusaraj@gmail.com>
This commit is contained in:
parent
b7b81afe55
commit
daf34ae7e2
|
@ -157,9 +157,12 @@ export default Controller.extend({
|
|||
return false;
|
||||
}
|
||||
|
||||
const currentThemeColorSchemeId = userThemes.findBy("id", themeId)
|
||||
.color_scheme_id;
|
||||
return userColorSchemes.findBy("id", currentThemeColorSchemeId);
|
||||
const theme = userThemes.findBy("id", themeId);
|
||||
if (!theme) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return userColorSchemes.findBy("id", theme.color_scheme_id);
|
||||
},
|
||||
|
||||
showColorSchemeNoneItem: not("currentSchemeCanBeSelected"),
|
||||
|
|
|
@ -79,7 +79,7 @@ acceptance("User Preferences - Interface", function (needs) {
|
|||
test("shows light color scheme default option when theme's color scheme is not user selectable", async function (assert) {
|
||||
let site = Site.current();
|
||||
site.set("user_themes", [
|
||||
{ id: 1, name: "Cool Theme", color_scheme_id: null },
|
||||
{ theme_id: 1, name: "Cool Theme", color_scheme_id: null },
|
||||
]);
|
||||
|
||||
site.set("user_color_schemes", [{ id: 2, name: "Cool Breeze" }]);
|
||||
|
|
|
@ -792,6 +792,13 @@ export function applyDefaultHandlers(pretender) {
|
|||
});
|
||||
});
|
||||
|
||||
pretender.get("/color-scheme-stylesheet/2/1.json", () => {
|
||||
return response(200, {
|
||||
color_scheme_id: 2,
|
||||
new_href: "/stylesheets/color_definitions_scheme_name_2_hash.css",
|
||||
});
|
||||
});
|
||||
|
||||
pretender.get("/inline-onebox", (request) => {
|
||||
if (
|
||||
request.queryParams.urls.includes("http://www.example.com/has-title.html")
|
||||
|
|
Loading…
Reference in New Issue
Block a user