Skip to content

Commit

Permalink
removed a console log lol
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewC committed Nov 1, 2023
1 parent d3388f4 commit 0b32296
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ jobs:
yarn install
- name: Run tests
run: |
yarn test
yarn test
26 changes: 13 additions & 13 deletions __tests__/MoreScreen.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ beforeAll(() => {
afterAll(() => {
console.log.mockRestore();
console.error.mockRestore();
moxios.uninstall();
// moxios.uninstall();
});

describe("MorePage", () => {
Expand All @@ -47,20 +47,20 @@ describe("MorePage", () => {
// Check if the onValueChange prop exists
expect(toggleButton.props().onValueChange).toBeDefined();
});
});

describe("opens email link when 'Report a Bug' is pressed", () => {
it("opens email link when 'Report a Bug' is pressed", () => {
const spy = jest.spyOn(Linking, 'openURL');
const wrapper = shallow(<MorePage />);
const emailButton = wrapper.findWhere((node) => node.key() === "Email");
describe("opens email link when 'Report a Bug' is pressed", () => {
it("opens email link when 'Report a Bug' is pressed", () => {
const spy = jest.spyOn(Linking, 'openURL');
const wrapper = shallow(<MorePage />);
const emailButton = wrapper.findWhere((node) => node.key() === "Email");

emailButton.simulate('press');
emailButton.simulate('press');

expect(spy).toHaveBeenCalledWith(
"mailto:[email protected]?subject=Bug%20Report%20on%20'Where's%20Religion%3F'&body=Please%20provide%20details%20of%20your%20issue%20you%20are%20facing%20here."
);
});
});
expect(spy).toHaveBeenCalledWith(
"mailto:[email protected]?subject=Bug%20Report%20on%20'Where's%20Religion%3F'&body=Please%20provide%20details%20of%20your%20issue%20you%20are%20facing%20here."
);
});

describe("calls the logout function when 'Logout' is pressed", () => {
it("calls the logout function when 'Logout' is pressed", () => {
Expand All @@ -73,4 +73,4 @@ describe("MorePage", () => {
expect(spy).toHaveBeenCalled();
});
});
});
});
3 changes: 1 addition & 2 deletions lib/models/user_class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export class User {
this.userData = null;
this.clearUser();
this.notifyLoginState();
console.log("User logged out");
// console.log("User logged out");
}
})
.catch((err) => {
Expand Down Expand Up @@ -131,7 +131,6 @@ export class User {
return onboarded === '1';
}


public async getRoles(): Promise<{
administrator: boolean;
contributor: boolean;
Expand Down
3 changes: 1 addition & 2 deletions lib/screens/MorePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ import {
import { Ionicons } from "@expo/vector-icons";
import { User } from "../models/user_class";
import { useTheme } from "../components/ThemeProvider";

// import Accordion from "@gapur/react-native-accordion";
import Accordion from "@gapur/react-native-accordion";

const user = User.getInstance();
const { width, height } = Dimensions.get("window");
Expand Down

0 comments on commit 0b32296

Please sign in to comment.