Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
M-Valentino committed Feb 27, 2023
2 parents b7b3478 + a720f32 commit 139f999
Show file tree
Hide file tree
Showing 10 changed files with 869 additions and 60 deletions.
260 changes: 260 additions & 0 deletions __unit__/SearchScreenFilter.test.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions __unit__/jest.firebase_setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Jest Firebase mocking; error fix for Google Closure library
window.addEventListener = jest.fn()
window.attachEvent = jest.fn()
1 change: 1 addition & 0 deletions __unit__/mocks/fileMock.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -371,3 +371,6 @@ def isNewArchitectureEnabled() {
return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
}

// For the react-native-vector-icons package
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"

43 changes: 43 additions & 0 deletions e2e/searchScreenFilter.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
describe('Example', () => {
beforeAll(async () => {
await device.launchApp();
});

beforeEach(async () => { // Reload React Native between tests for fresh state, and also login/reach search screen
await device.reloadReactNative();
await element(by.id('Test_SignInSkip')).longPress();
});

// Successfully load the filtering submenu and respective touchable opacity
it('should load the filter submenu when the filter button is pressed', async () => {
await element(by.id('Test_FilterButton')).longPress();
await expect(element(by.id('Test_FilterCountryButton'))).toBeVisible()
await expect(element(by.id('Test_FilterInStockButton'))).toBeVisible();
await expect(element(by.id('Test_FilterOnSaleButton'))).toBeVisible();
await expect(element(by.id('Test_FilterByFavoritedButton'))).toBeVisible();
});

// Successfully exit the menu after tapping outside of its area
it('should remove the filter submenu after tapping outside it', async () => {
await element(by.id('Test_FilterButton')).longPress();
await element(by.id('Test_FilterSubmenuOpacity')).longPress();
await expect(element(by.id('Test_FilterSubmenuModal'))).not.toBeVisible();
});

// Successfully load the country submenu
it('should load the country filter submenu when the country filter button is pressed', async () => {
await element(by.id('Test_FilterButton')).longPress();
await element(by.id('Test_FilterCountryButton')).longPress();
await expect(element(by.id('Test_FilterCountrySubmenu'))).toExist();
});

// Successfully exit the country submenu after tapping outside of its area to reach the original filter submenu
it('should remove the filter submenu after tapping outside it', async () => {
await element(by.id('Test_FilterButton')).longPress();
await element(by.id('Test_FilterCountryButton')).longPress();
await element(by.id('Test_FilterCountrySubmenuOpacity')).longPress();
await expect(element(by.id('Test_FilterCountrySubmenuModal'))).not.toExist();
await expect(element(by.id('Test_FilterCountryButton'))).toExist();
});

});
Loading

0 comments on commit 139f999

Please sign in to comment.