Ensure chats pane in settings is visible

This commit is contained in:
trevor-signal 2024-03-01 16:52:17 -05:00 committed by GitHub
parent b379ec115d
commit 38adef4233
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 33 additions and 11 deletions

View file

@ -4,6 +4,7 @@
import { config } from './config';
import {
getEnvironment,
isTestEnvironment,
parseEnvironment,
setEnvironment,
} from '../environment';
@ -12,4 +13,7 @@ setEnvironment(parseEnvironment(config.environment));
const environment = getEnvironment();
export { environment };
const isTestOrMockEnvironment =
isTestEnvironment(environment) || Boolean(process.env.MOCK_TEST);
export { environment, isTestOrMockEnvironment };

View file

@ -59,6 +59,7 @@ export class App extends EventEmitter {
args: this.options.args.slice(),
env: {
...process.env,
MOCK_TEST: 'true',
SIGNAL_CI_CONFIG: this.options.config,
},
locale: 'en',

View file

@ -31,14 +31,27 @@ describe('settings', function (this: Mocha.Suite) {
await bootstrap.teardown();
});
it('settings window loads when opened', async () => {
it('settings window and all panes load when opened', async () => {
const window = await app.getWindow();
const newPagePromise = window.context().waitForEvent('page');
await window.locator('.NavTabs__ItemIcon--Settings').click();
const settingsWindow = await newPagePromise;
await settingsWindow.getByText('Device Name').waitFor();
await settingsWindow.getByText('Appearance').click();
await settingsWindow.getByText('Language').first().waitFor();
await settingsWindow.getByText('Chats').click();
await settingsWindow.getByText('Sent media quality').waitFor();
await settingsWindow.getByText('Calls').click();
await settingsWindow.getByText('Enable incoming calls').waitFor();
await settingsWindow.getByText('Notifications').click();
await settingsWindow.getByText('Notification content').waitFor();
await settingsWindow.getByText('Privacy').click();
await settingsWindow.getByText('Read receipts').waitFor();
});
});

View file

@ -208,7 +208,7 @@ export function _bidiIsolate(text: string): string {
* ```
*/
export function bidiIsolate(text: string): string {
if (process.env.IS_TESTS != null) {
if (window.SignalContext.isTestOrMockEnvironment()) {
// Turn this off in tests to make it easier to compare strings
return text;
}

View file

@ -54,6 +54,7 @@ export type MinimalSignalContextType = {
getNodeVersion: () => string;
getPath: (name: 'userData' | 'home' | 'install') => string;
getVersion: () => string;
isTestOrMockEnvironment: () => boolean;
nativeThemeListener: NativeThemeType;
restartApp: () => void;
Settings: {

View file

@ -10,7 +10,7 @@ import { activeWindowService } from '../context/activeWindowService';
import { config } from '../context/config';
import { createNativeThemeListener } from '../context/createNativeThemeListener';
import { createSetting } from '../util/preload';
import { environment } from '../context/environment';
import { environment, isTestOrMockEnvironment } from '../context/environment';
import {
localeDisplayNames,
countryDisplayNames,
@ -52,6 +52,7 @@ export const MinimalSignalContext: MinimalSignalContextType = {
getHourCyclePreference: () => config.hourCyclePreference,
getPreferredSystemLocales: () => config.preferredSystemLocales,
getLocaleOverride: () => config.localeOverride,
isTestOrMockEnvironment: () => isTestOrMockEnvironment,
nativeThemeListener: createNativeThemeListener(ipcRenderer, window),
restartApp: () => ipcRenderer.send('restart'),
OS: {