aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWouter Admiraal <wouter.admiraal@sonarsource.com>2023-05-02 12:26:29 +0200
committersonartech <sonartech@sonarsource.com>2023-05-02 20:02:55 +0000
commit897564cfdce888bd5b11669cbf80d47901c16c15 (patch)
treef66c561c3419e558a2014917a960f5afd78cb612
parentdc738c8dfd4f960050debcfae2ff853d06439cb9 (diff)
downloadsonarqube-897564cfdce888bd5b11669cbf80d47901c16c15.tar.gz
sonarqube-897564cfdce888bd5b11669cbf80d47901c16c15.zip
[NO JIRA] Fix warnings in RTL tests
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/__tests__/QualityProfilesApp-it.tsx22
1 files changed, 16 insertions, 6 deletions
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/__tests__/QualityProfilesApp-it.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/__tests__/QualityProfilesApp-it.tsx
index 00c6ac5aba2..95352a39b97 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/__tests__/QualityProfilesApp-it.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/__tests__/QualityProfilesApp-it.tsx
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { getByText } from '@testing-library/react';
+import { act, getByText } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import selectEvent from 'react-select-event';
import { byRole } from 'testing-library-selector';
@@ -138,7 +138,9 @@ it('should be able to extend Quality Profile', async () => {
await user.clear(ui.namePropupInput.get());
await user.type(ui.namePropupInput.get(), ui.newCQualityProfileName);
- await user.click(ui.extendButton.get());
+ await act(async () => {
+ await user.click(ui.extendButton.get());
+ });
expect(await ui.listLinkNewCQualityProfile.find()).toBeInTheDocument();
// From the create form
@@ -148,7 +150,9 @@ it('should be able to extend Quality Profile', async () => {
await selectEvent.select(ui.languageSelect.get(), 'C');
await selectEvent.select(ui.profileExtendSelect.get(), ui.newCQualityProfileName);
await user.type(ui.nameCreatePopupInput.get(), ui.newCQualityProfileNameFromCreateButton);
- await user.click(ui.createButton.get(ui.popup.get()));
+ await act(async () => {
+ await user.click(ui.createButton.get(ui.popup.get()));
+ });
expect(await ui.listLinkNewCQualityProfileFromCreateButton.find()).toBeInTheDocument();
});
@@ -164,7 +168,9 @@ it('should be able to copy Quality Profile', async () => {
await user.clear(ui.namePropupInput.get());
await user.type(ui.namePropupInput.get(), ui.newCQualityProfileName);
- await user.click(ui.copyButton.get(ui.popup.get()));
+ await act(async () => {
+ await user.click(ui.copyButton.get(ui.popup.get()));
+ });
expect(await ui.listLinkNewCQualityProfile.find()).toBeInTheDocument();
// From the create form
@@ -175,7 +181,9 @@ it('should be able to copy Quality Profile', async () => {
await selectEvent.select(ui.languageSelect.get(), 'C');
await selectEvent.select(ui.profileCopySelect.get(), ui.newCQualityProfileName);
await user.type(ui.nameCreatePopupInput.get(), ui.newCQualityProfileNameFromCreateButton);
- await user.click(ui.createButton.get(ui.popup.get()));
+ await act(async () => {
+ await user.click(ui.createButton.get(ui.popup.get()));
+ });
expect(await ui.listLinkNewCQualityProfileFromCreateButton.find()).toBeInTheDocument();
});
@@ -191,7 +199,9 @@ it('should be able to create blank Quality Profile', async () => {
await user.click(ui.blankRadio.get());
await selectEvent.select(ui.languageSelect.get(), 'C');
await user.type(ui.nameCreatePopupInput.get(), ui.newCQualityProfileName);
- await user.click(ui.createButton.get(ui.popup.get()));
+ await act(async () => {
+ await user.click(ui.createButton.get(ui.popup.get()));
+ });
expect(await ui.listLinkNewCQualityProfile.find()).toBeInTheDocument();
});