Update tests for project time settings and world settings, add new properties and scenarios
This commit is contained in:
@@ -10,10 +10,13 @@ describe("createSetProjectTimeSettingsCommand", () => {
|
||||
const originalTime = cloneProjectTimeSettings(
|
||||
store.getState().projectDocument.time
|
||||
);
|
||||
const nextTime = {
|
||||
startTimeOfDayHours: 18.5,
|
||||
dayLengthMinutes: 12
|
||||
};
|
||||
const nextTime = cloneProjectTimeSettings(originalTime);
|
||||
nextTime.startDayNumber = 4;
|
||||
nextTime.startTimeOfDayHours = 18.5;
|
||||
nextTime.dayLengthMinutes = 12;
|
||||
nextTime.sunriseTimeOfDayHours = 5.75;
|
||||
nextTime.sunsetTimeOfDayHours = 20.25;
|
||||
nextTime.night.lightIntensityFactor = 0.28;
|
||||
|
||||
store.executeCommand(
|
||||
createSetProjectTimeSettingsCommand({
|
||||
|
||||
@@ -106,4 +106,13 @@ describe("world settings helpers", () => {
|
||||
|
||||
expect(areWorldSettingsEqual(left, right)).toBe(false);
|
||||
});
|
||||
|
||||
it("treats the scene project-time lighting toggle as part of authored world equality", () => {
|
||||
const left = createDefaultWorldSettings();
|
||||
const right = cloneWorldSettings(left);
|
||||
|
||||
right.projectTimeLightingEnabled = false;
|
||||
|
||||
expect(areWorldSettingsEqual(left, right)).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -108,9 +108,39 @@ describe("project document JSON", () => {
|
||||
normalStrength: 0.85
|
||||
}
|
||||
};
|
||||
document.scenes["scene-cellar"].world.projectTimeLightingEnabled = false;
|
||||
document.time = {
|
||||
startDayNumber: 3,
|
||||
startTimeOfDayHours: 18.5,
|
||||
dayLengthMinutes: 16
|
||||
dayLengthMinutes: 16,
|
||||
sunriseTimeOfDayHours: 5.5,
|
||||
sunsetTimeOfDayHours: 19.75,
|
||||
dawnDurationHours: 1.25,
|
||||
duskDurationHours: 1.75,
|
||||
dawn: {
|
||||
skyTopColorHex: "#6680bc",
|
||||
skyBottomColorHex: "#f3b07a",
|
||||
ambientColorHex: "#ffe0ba",
|
||||
ambientIntensityFactor: 0.78,
|
||||
lightColorHex: "#ffd29d",
|
||||
lightIntensityFactor: 0.82
|
||||
},
|
||||
dusk: {
|
||||
skyTopColorHex: "#313d70",
|
||||
skyBottomColorHex: "#e27b5e",
|
||||
ambientColorHex: "#f0bf9f",
|
||||
ambientIntensityFactor: 0.58,
|
||||
lightColorHex: "#ff9d79",
|
||||
lightIntensityFactor: 0.61
|
||||
},
|
||||
night: {
|
||||
skyTopColorHex: "#070f1c",
|
||||
skyBottomColorHex: "#18253b",
|
||||
ambientColorHex: "#1a2941",
|
||||
ambientIntensityFactor: 0.22,
|
||||
lightColorHex: "#95b0ff",
|
||||
lightIntensityFactor: 0.19
|
||||
}
|
||||
};
|
||||
|
||||
const serializedDocument = serializeProjectDocument(document);
|
||||
|
||||
Reference in New Issue
Block a user