package usecase

import "testing"

func TestApplyPatchDevModeEnabled(t *testing.T) {
	enabled := true
	disabled := false
	current := defaultSettings()

	next := applyPatch(current, SettingsPatch{DevModeEnabled: &enabled})
	if !next.DevModeEnabled {
		t.Fatal("expected dev_mode_enabled true")
	}

	next = applyPatch(next, SettingsPatch{DevModeEnabled: &disabled})
	if next.DevModeEnabled {
		t.Fatal("expected dev_mode_enabled false after toggle off")
	}
}

func TestMergeSettingsDevModeEnabled(t *testing.T) {
	merged := mergeSettings(defaultSettings(), map[string]interface{}{
		"dev_mode_enabled": true,
	})
	if !merged.DevModeEnabled {
		t.Fatal("expected merged dev_mode_enabled true")
	}
}
