fix: Add postAuthenticate hook for source control preferences (no-changelog) (#6629)

* feat: handle source control settings in post-authenticate app hook

* fix: only trigger post authenticate when logging in

* chore: remove console.log

* chore: fix linting issues

* test: update source control test
This commit is contained in:
Alex Grozav
2023-07-10 12:35:36 +02:00
committed by GitHub
parent 9460bdd3be
commit a95862b6e2
4 changed files with 44 additions and 8 deletions

View File

@@ -69,10 +69,13 @@ describe('SettingsSourceControl', () => {
it('should render user flow happy path', async () => {
vi.spyOn(settingsStore, 'isEnterpriseFeatureEnabled').mockReturnValue(true);
const updatePreferencesSpy = vi.spyOn(sourceControlStore, 'updatePreferences');
const { container, getByTestId, queryByTestId, getByRole } = renderComponent();
await waitFor(() => expect(sourceControlStore.preferences.publicKey).not.toEqual(''));
const connectButton = getByTestId('source-control-connect-button');
expect(connectButton).toBeDisabled();
@@ -104,7 +107,7 @@ describe('SettingsSourceControl', () => {
await userEvent.type(authorEmail, 'com');
await userEvent.tab();
expect(connectButton).toBeEnabled();
await waitFor(() => expect(connectButton).toBeEnabled());
expect(queryByTestId('source-control-save-settings-button')).not.toBeInTheDocument();
await userEvent.click(connectButton);
@@ -139,5 +142,5 @@ describe('SettingsSourceControl', () => {
await waitFor(() =>
expect(queryByTestId('source-control-connected-content')).not.toBeInTheDocument(),
);
});
}, 10000);
});