chore(tests): update AccessControlForm snapshots [EE-2348] (#6361)

pull/6362/head
Chaim Lev-Ari 2022-01-07 17:14:36 +02:00 committed by GitHub
parent 5362e15624
commit c24d8fab0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 16 deletions

View File

@ -2,11 +2,7 @@ import { server, rest } from '@/setup-tests/server';
import { ResourceControlOwnership as RCO } from '@/portainer/models/resourceControl/resourceControlOwnership';
import { UserContext } from '@/portainer/hooks/useUser';
import { UserViewModel } from '@/portainer/models/user';
import {
renderWithQueryClient,
within,
waitFor,
} from '@/react-tools/test-utils';
import { renderWithQueryClient, within } from '@/react-tools/test-utils';
import { Team } from '@/portainer/teams/types';
import { ResourceControlViewModel } from '@/portainer/models/resourceControl/resourceControl';
import { createMockTeams } from '@/react-tools/test-mocks';
@ -310,11 +306,9 @@ async function renderComponent(
</UserContext.Provider>
);
await waitFor(async () =>
expect(
await renderResult.findByLabelText(/Enable access control/)
).toBeVisible()
);
await expect(
renderResult.findByLabelText(/Enable access control/)
).resolves.toBeVisible();
return renderResult;
}

View File

@ -4,10 +4,6 @@ exports[`when access control is enabled, ownership is restricted and no teams or
exports[`when access control is enabled, ownership is restricted and no teams or users, should be invalid 2`] = `"You must specify at least one team"`;
exports[`when access control is enabled, ownership is restricted and no teams or users, should be valid 1`] = `"You must specify at least one team"`;
exports[`when access control is enabled, ownership is restricted and no teams or users, should be valid 2`] = `"You must specify at least one team"`;
exports[`when access control is enabled, ownership is restricted, user is admin but no users, should be valid 1`] = `"You must specify at least one user."`;
exports[`when only access control is enabled, should be invalid 1`] = `"ownership is a required field"`;

View File

@ -117,6 +117,7 @@
"rc-slider": "^9.7.5",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-query": "^3.34.3",
"react-is": "^17.0.2",
"react-select": "^5.2.1",
"react-table": "^7.7.0",
@ -214,7 +215,6 @@
"postcss": "7",
"postcss-loader": "4",
"prettier": "^2.5.1",
"react-query": "^3.34.3",
"react-test-renderer": "^17.0.2",
"source-map-loader": "^3.0.0",
"speed-measure-webpack-plugin": "^1.5.0",
@ -247,4 +247,4 @@
"pre-commit": "lint-staged"
}
}
}
}