-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add TextEncoder and TextDecoder polyfills, refactor App component to …
…pass location prop, and update @scality/core-ui dependency
- Loading branch information
1 parent
acddd26
commit 3e5e92f
Showing
8 changed files
with
168 additions
and
179 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -165,12 +165,8 @@ const commonSetup = async () => { | |
<> | ||
<NotificationDisplayer /> | ||
<Routes> | ||
<Route path="/alerts"> | ||
<div>Redirected Alert Page</div> | ||
</Route> | ||
<Route path="/"> | ||
<ConfigureAlerting /> | ||
</Route> | ||
<Route path="/alerts" element={<div>Redirected Alert Page</div>} /> | ||
<Route path="/" element={<ConfigureAlerting />} /> | ||
</Routes> | ||
</>, | ||
); | ||
|
@@ -259,6 +255,13 @@ describe('<ConfigureAlerting />', () => { | |
|
||
await act(async () => { | ||
await userEvent.click(selectors.authSelect.authClick()); | ||
}); | ||
|
||
await waitFor(() => { | ||
expect(selectors.authSelect.optionCramMd5()).toBeInTheDocument(); | ||
}); | ||
|
||
await act(async () => { | ||
await userEvent.click(selectors.authSelect.optionCramMd5()); | ||
}); | ||
|
||
|
@@ -268,6 +271,13 @@ describe('<ConfigureAlerting />', () => { | |
|
||
await act(async () => { | ||
await userEvent.click(selectors.authSelect.authClick()); | ||
}); | ||
|
||
await waitFor(() => { | ||
expect(selectors.authSelect.optionPlain()).toBeInTheDocument(); | ||
}); | ||
|
||
await act(async () => { | ||
await userEvent.click(selectors.authSelect.optionPlain()); | ||
}); | ||
|
||
|
@@ -355,8 +365,18 @@ describe('<ConfigureAlerting />', () => { | |
it('show errors on submit with not all required field', async () => { | ||
await commonSetup(); | ||
|
||
await waitFor(() => { | ||
expect(selectors.enableConfiguration()).toBeInTheDocument(); | ||
}); | ||
await act(async () => { | ||
await userEvent.click(selectors.enableConfiguration()); | ||
}); | ||
|
||
await waitFor(() => { | ||
expect(selectors.saveButton()).toBeInTheDocument(); | ||
}); | ||
|
||
await act(async () => { | ||
await userEvent.click(selectors.saveButton()); | ||
}); | ||
|
||
|
@@ -403,7 +423,13 @@ describe('<ConfigureAlerting />', () => { | |
selectors.recipient(), | ||
'[email protected], [email protected]', | ||
); | ||
}); | ||
|
||
await waitFor(() => { | ||
expect(selectors.saveButton()).toBeInTheDocument(); | ||
}); | ||
|
||
await act(async () => { | ||
await userEvent.click(selectors.saveButton()); | ||
}); | ||
|
||
|
@@ -460,19 +486,38 @@ spec: | |
); | ||
await userEvent.clear(selectors.port()); | ||
await userEvent.type(selectors.port(), '22'); | ||
}); | ||
|
||
await waitFor(() => { | ||
expect(selectors.authSelect.authClick()).toBeInTheDocument(); | ||
}); | ||
|
||
await act(async () => { | ||
await userEvent.click(selectors.authSelect.authClick()); | ||
}); | ||
|
||
await waitFor(() => { | ||
expect(selectors.authSelect.optionNoAuth()).toBeInTheDocument(); | ||
}); | ||
|
||
await act(async () => { | ||
await userEvent.click(selectors.authSelect.optionNoAuth()); | ||
}); | ||
|
||
await userEvent.clear(selectors.sender()); | ||
await userEvent.type(selectors.sender(), '[email protected]'); | ||
await userEvent.clear(selectors.sender()); | ||
await userEvent.type(selectors.sender(), '[email protected]'); | ||
|
||
await userEvent.clear(selectors.recipient()); | ||
await userEvent.type( | ||
selectors.recipient(), | ||
'[email protected], [email protected]', | ||
); | ||
await userEvent.clear(selectors.recipient()); | ||
await userEvent.type( | ||
selectors.recipient(), | ||
'[email protected], [email protected]', | ||
); | ||
|
||
await waitFor(() => { | ||
expect(selectors.saveButton()).toBeInTheDocument(); | ||
}); | ||
|
||
await act(async () => { | ||
await userEvent.click(selectors.saveButton()); | ||
}); | ||
|
||
|
@@ -542,7 +587,13 @@ spec: | |
selectors.recipient(), | ||
'[email protected], [email protected]', | ||
); | ||
}); | ||
|
||
await waitFor(() => { | ||
expect(selectors.saveButton()).toBeInTheDocument(); | ||
}); | ||
|
||
await act(async () => { | ||
await userEvent.click(selectors.saveButton()); | ||
}); | ||
|
||
|
@@ -602,21 +653,21 @@ spec: | |
'smtp4dev.default.svc.cluster.local', | ||
); | ||
await userEvent.type(selectors.port(), '42'); | ||
}); | ||
|
||
await userEvent.click(selectors.authSelect.authClick()); | ||
await userEvent.click(selectors.authSelect.optionLogin()); | ||
await userEvent.click(selectors.authSelect.authClick()); | ||
await userEvent.click(selectors.authSelect.optionLogin()); | ||
|
||
await userEvent.type(selectors.username(), 'Renard'); | ||
await userEvent.type(selectors.password(), 'Renard Password'); | ||
await userEvent.type(selectors.username(), 'Renard'); | ||
await userEvent.type(selectors.password(), 'Renard Password'); | ||
|
||
await userEvent.type(selectors.sender(), '[email protected]'); | ||
await userEvent.type( | ||
selectors.recipient(), | ||
'[email protected], [email protected]', | ||
); | ||
await userEvent.type(selectors.sender(), '[email protected]'); | ||
await userEvent.type( | ||
selectors.recipient(), | ||
'[email protected], [email protected]', | ||
); | ||
|
||
await userEvent.click(selectors.saveButton()); | ||
}); | ||
await userEvent.click(selectors.saveButton()); | ||
|
||
await waitForElementToBeRemoved(() => { | ||
return screen.getByText(/Saving\.\.\./); | ||
|
@@ -670,21 +721,21 @@ spec: | |
'smtp4dev.default.svc.cluster.local', | ||
); | ||
await userEvent.type(selectors.port(), '42'); | ||
}); | ||
|
||
await userEvent.click(selectors.authSelect.authClick()); | ||
await userEvent.click(selectors.authSelect.optionCramMd5()); | ||
await userEvent.click(selectors.authSelect.authClick()); | ||
await userEvent.click(selectors.authSelect.optionCramMd5()); | ||
|
||
await userEvent.type(selectors.username(), 'Renard'); | ||
await userEvent.type(selectors.secret(), 'xxxyyyzzz-secret'); | ||
await userEvent.type(selectors.username(), 'Renard'); | ||
await userEvent.type(selectors.secret(), 'xxxyyyzzz-secret'); | ||
|
||
await userEvent.type(selectors.sender(), '[email protected]'); | ||
await userEvent.type( | ||
selectors.recipient(), | ||
'[email protected], [email protected]', | ||
); | ||
await userEvent.type(selectors.sender(), '[email protected]'); | ||
await userEvent.type( | ||
selectors.recipient(), | ||
'[email protected], [email protected]', | ||
); | ||
|
||
await userEvent.click(selectors.saveButton()); | ||
}); | ||
await userEvent.click(selectors.saveButton()); | ||
|
||
await waitForElementToBeRemoved(() => { | ||
return screen.getByText(/Saving\.\.\./); | ||
|
@@ -738,22 +789,21 @@ spec: | |
'smtp4dev.default.svc.cluster.local', | ||
); | ||
await userEvent.type(selectors.port(), '42'); | ||
}); | ||
await userEvent.click(selectors.authSelect.authClick()); | ||
await userEvent.click(selectors.authSelect.optionPlain()); | ||
|
||
await userEvent.click(selectors.authSelect.authClick()); | ||
await userEvent.click(selectors.authSelect.optionPlain()); | ||
|
||
await userEvent.type(selectors.identity(), 'RenardID'); | ||
await userEvent.type(selectors.username(), 'Renard'); | ||
await userEvent.type(selectors.password(), 'xxxyyyzzz-password'); | ||
await userEvent.type(selectors.identity(), 'RenardID'); | ||
await userEvent.type(selectors.username(), 'Renard'); | ||
await userEvent.type(selectors.password(), 'xxxyyyzzz-password'); | ||
|
||
await userEvent.type(selectors.sender(), '[email protected]'); | ||
await userEvent.type( | ||
selectors.recipient(), | ||
'[email protected], [email protected]', | ||
); | ||
await userEvent.type(selectors.sender(), '[email protected]'); | ||
await userEvent.type( | ||
selectors.recipient(), | ||
'[email protected], [email protected]', | ||
); | ||
|
||
await userEvent.click(selectors.saveButton()); | ||
}); | ||
await userEvent.click(selectors.saveButton()); | ||
|
||
await waitForElementToBeRemoved(() => { | ||
return screen.getByText(/Saving\.\.\./); | ||
|
@@ -876,21 +926,20 @@ spec: | |
'smtp4dev.default.svc.cluster.local', | ||
); | ||
await userEvent.type(selectors.port(), '42'); | ||
}); | ||
await userEvent.click(selectors.authSelect.authClick()); | ||
await userEvent.click(selectors.authSelect.optionLogin()); | ||
|
||
await userEvent.click(selectors.authSelect.authClick()); | ||
await userEvent.click(selectors.authSelect.optionLogin()); | ||
await userEvent.type(selectors.username(), 'Renard'); | ||
await userEvent.type(selectors.password(), 'Renard Password'); | ||
|
||
await userEvent.type(selectors.username(), 'Renard'); | ||
await userEvent.type(selectors.password(), 'Renard Password'); | ||
await userEvent.type(selectors.sender(), '[email protected]'); | ||
await userEvent.type( | ||
selectors.recipient(), | ||
'[email protected], [email protected]', | ||
); | ||
|
||
await userEvent.type(selectors.sender(), '[email protected]'); | ||
await userEvent.type( | ||
selectors.recipient(), | ||
'[email protected], [email protected]', | ||
); | ||
|
||
await userEvent.click(selectors.sendTestingEmailButton()); | ||
}); | ||
await userEvent.click(selectors.sendTestingEmailButton()); | ||
|
||
expect(selectors.sendTestingEmailButton()).toBeDisabled(); | ||
await waitForElementToBeRemoved(() => { | ||
|
@@ -950,22 +999,22 @@ spec: | |
'smtp4dev.default.svc.cluster.local', | ||
); | ||
await userEvent.type(selectors.port(), '42'); | ||
}); | ||
|
||
await userEvent.click(selectors.authSelect.authClick()); | ||
await userEvent.click(selectors.authSelect.optionPlain()); | ||
await userEvent.click(selectors.authSelect.authClick()); | ||
await userEvent.click(selectors.authSelect.optionPlain()); | ||
|
||
await userEvent.type(selectors.identity(), 'Renard ID'); | ||
await userEvent.type(selectors.username(), 'Renard'); | ||
await userEvent.type(selectors.password(), 'Renard Password'); | ||
await userEvent.type(selectors.identity(), 'Renard ID'); | ||
await userEvent.type(selectors.username(), 'Renard'); | ||
await userEvent.type(selectors.password(), 'Renard Password'); | ||
|
||
await userEvent.type(selectors.sender(), '[email protected]'); | ||
await userEvent.type( | ||
selectors.recipient(), | ||
'[email protected], [email protected]', | ||
); | ||
await userEvent.type(selectors.sender(), '[email protected]'); | ||
await userEvent.type( | ||
selectors.recipient(), | ||
'[email protected], [email protected]', | ||
); | ||
|
||
await userEvent.click(selectors.sendTestingEmailButton()); | ||
}); | ||
await userEvent.click(selectors.sendTestingEmailButton()); | ||
|
||
expect(selectors.sendTestingEmailButton()).toBeDisabled(); | ||
await waitForElementToBeRemoved(() => { | ||
|
Oops, something went wrong.