ScrollerPage now resolves the active Block from ScheduleManager (reusing the existing stream-switch path), honoring dynamicAudio true/false and falling back to local selection for gaps, no schedule, or toggle off. Adds a 'Schedule' On/Off entry (default On) in System Settings persisted in config.yaml, and config plumbing (proclamation.schedule_enabled). All on-device schedule times remain 12h AM/PM.
57 lines
2.2 KiB
C++
57 lines
2.2 KiB
C++
#include "settings_menu.h"
|
|
#include <gtest/gtest.h>
|
|
#include <set>
|
|
#include <string>
|
|
|
|
namespace settings = radiantwave::settings;
|
|
|
|
TEST(SystemSettingsMenuTest, ListsTheSystemSettingsInOrder) {
|
|
const auto entries = settings::systemSettingEntries();
|
|
ASSERT_EQ(entries.size(), 7u);
|
|
EXPECT_EQ(entries[0].label, "Email Address");
|
|
EXPECT_EQ(entries[0].id, settings::SystemSettingId::EmailAddress);
|
|
EXPECT_EQ(entries[1].label, "License Key");
|
|
EXPECT_EQ(entries[1].id, settings::SystemSettingId::LicenseKey);
|
|
EXPECT_EQ(entries[2].label, "System Name");
|
|
EXPECT_EQ(entries[2].id, settings::SystemSettingId::SystemName);
|
|
EXPECT_EQ(entries[3].label, "Schedule");
|
|
EXPECT_EQ(entries[3].id, settings::SystemSettingId::Schedule);
|
|
EXPECT_EQ(entries[4].label, "WiFi Setup");
|
|
EXPECT_EQ(entries[4].id, settings::SystemSettingId::WiFiSetup);
|
|
EXPECT_EQ(entries[5].label, "Time Zone Setup");
|
|
EXPECT_EQ(entries[5].id, settings::SystemSettingId::Timezone);
|
|
EXPECT_EQ(entries[6].label, "Date Format");
|
|
EXPECT_EQ(entries[6].id, settings::SystemSettingId::DateFormat);
|
|
}
|
|
|
|
TEST(SystemSettingsMenuTest, LabelsAreNonEmptyAndUnique) {
|
|
const auto entries = settings::systemSettingEntries();
|
|
std::set<std::string> labels;
|
|
std::set<int> ids;
|
|
for (const auto& entry : entries) {
|
|
EXPECT_FALSE(entry.label.empty());
|
|
labels.insert(entry.label);
|
|
ids.insert(static_cast<int>(entry.id));
|
|
}
|
|
EXPECT_EQ(labels.size(), entries.size());
|
|
EXPECT_EQ(ids.size(), entries.size());
|
|
}
|
|
|
|
TEST(SystemSettingsMenuTest, EveryEntryMapsToAKnownPage) {
|
|
for (const auto& entry : settings::systemSettingEntries()) {
|
|
switch (entry.id) {
|
|
case settings::SystemSettingId::EmailAddress:
|
|
case settings::SystemSettingId::LicenseKey:
|
|
case settings::SystemSettingId::SystemName:
|
|
case settings::SystemSettingId::Schedule:
|
|
case settings::SystemSettingId::WiFiSetup:
|
|
case settings::SystemSettingId::Timezone:
|
|
case settings::SystemSettingId::DateFormat:
|
|
SUCCEED();
|
|
break;
|
|
default:
|
|
FAIL() << "Unhandled SystemSettingId for label " << entry.label;
|
|
}
|
|
}
|
|
}
|