Skip to content

Commit

Permalink
Merge pull request #406 from lifeomic/fix-broken-oauth-test
Browse files Browse the repository at this point in the history
Fix Login Screen Tests
  • Loading branch information
sternetj committed Oct 10, 2023
2 parents 958c496 + 900a039 commit baad770
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions src/screens/LoginScreen.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,29 +27,30 @@ const useDeveloperConfigMock = useDeveloperConfig as jest.Mock;
const useStylesMock = useStyles as jest.Mock;
const usePendingInviteMock = usePendingInvite as jest.Mock;

beforeEach(() => {
useStylesMock.mockReturnValue({
styles: {
containerView: {},
},
});

useDeveloperConfigMock.mockReturnValue({
renderCustomLoginScreen: null,
});

usePendingInviteMock.mockReturnValue({
inviteParams: undefined,
});
});

const loginScreenInContext = (
<PaperProvider>
<LoginScreen />
</PaperProvider>
);

describe('LoginScreen', () => {
beforeEach(() => {
jest.useFakeTimers();

useStylesMock.mockReturnValue({
styles: {
containerView: {},
},
});

useDeveloperConfigMock.mockReturnValue({
renderCustomLoginScreen: null,
});

usePendingInviteMock.mockReturnValue({
inviteParams: undefined,
});
});
it('renders correctly', () => {
const { getByText } = render(loginScreenInContext);

Expand Down

0 comments on commit baad770

Please sign in to comment.