Skip to content

Commit

Permalink
Fix language settings test by toggling advanced mode on
Browse files Browse the repository at this point in the history
  • Loading branch information
albullington committed Dec 27, 2024
1 parent f6c5c2e commit 7e55957
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/integration/LanguageSettings.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ beforeAll( uniqueRealmBeforeAll );
afterAll( uniqueRealmAfterAll );
// /UNIQUE REALM SETUP

const toggleAdvancedMode = async ( ) => {
const advancedRadioButton = await screen
.findByText( /Advanced/ );
fireEvent.press( advancedRadioButton );
};

describe( "LanguageSettings", ( ) => {
test( "uses locale preference of the local device", ( ) => {
renderAppWithComponent( <Settings /> );
Expand Down Expand Up @@ -63,12 +69,14 @@ describe( "LanguageSettings", ( ) => {

test( "uses locale preference from server", async ( ) => {
renderAppWithComponent( <Settings /> );
await toggleAdvancedMode( );
const sciNameText = await screen.findByText( /Научное название/ );
expect( sciNameText ).toBeVisible( );
} );

test( "changes locales and updates server with new locale", async ( ) => {
renderAppWithComponent( <Settings /> );
await toggleAdvancedMode( );
const changeLocaleButton = await screen.findByText( /CHANGE APP LANGUAGE/ );
fireEvent.press( changeLocaleButton );
const picker = await screen.findByTestId( "ReactNativePicker" );
Expand Down

0 comments on commit 7e55957

Please sign in to comment.