mirror of
https://github.com/Boof2015/prism.git
synced 2026-08-12 05:10:51 +02:00
persist trim across sessions
This commit is contained in:
@@ -27,6 +27,7 @@ import {
|
||||
} from '../src/shared/windowGeometry'
|
||||
import { calculateResizedWindowBounds } from '../src/shared/windowResize'
|
||||
import { createDefaultTheme, resolveNativeThemeSource, resolveTheme } from '../src/shared/themeState'
|
||||
import { useAudioStore } from '../src/renderer/stores/audioStore'
|
||||
import { usePerformanceStore } from '../src/renderer/stores/performanceStore'
|
||||
import { buildProfileDraft, profilesMatch } from '../src/renderer/stores/profileDraft'
|
||||
import {
|
||||
@@ -1577,6 +1578,33 @@ test('applying a profile snapshot does not change the machine-local frame target
|
||||
}
|
||||
})
|
||||
|
||||
test('applying a profile snapshot does not change the machine-local trim', () => {
|
||||
const previousAudioState = useAudioStore.getState()
|
||||
const previousSettingsState = useSettingsStore.getState()
|
||||
|
||||
try {
|
||||
useAudioStore.setState({ inputGainDb: 6.5 })
|
||||
|
||||
const defaultProfile = createDefaultProfile('Default')
|
||||
const alternateProfile = createDefaultProfile('Live Mix')
|
||||
alternateProfile.hiddenScopes = []
|
||||
alternateProfile.scopeSettings.waveform.gainDb = 6
|
||||
|
||||
useSettingsStore.getState().applyExternalProfileSnapshot({
|
||||
activeProfileId: 'profile_live_mix',
|
||||
profiles: {
|
||||
profile_default: defaultProfile,
|
||||
profile_live_mix: alternateProfile,
|
||||
},
|
||||
})
|
||||
|
||||
assert.equal(useAudioStore.getState().inputGainDb, 6.5)
|
||||
} finally {
|
||||
useAudioStore.setState(previousAudioState)
|
||||
useSettingsStore.setState(previousSettingsState)
|
||||
}
|
||||
})
|
||||
|
||||
test('profile draft comparisons return to clean after reverting a change', () => {
|
||||
const baselineProfile = createDefaultProfile(DEFAULT_PROFILE_NAME)
|
||||
baselineProfile.windowBounds = { x: 24, y: 48, width: 900, height: 180 }
|
||||
|
||||
Reference in New Issue
Block a user