mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 10:00:01 -03:30
Fix a few unit-tests warnings
Fix a few unit-test warnings
This commit is contained in:
parent
acb6e3e6e9
commit
1471945b9e
@ -81,7 +81,8 @@
|
||||
"gridColumns",
|
||||
"rows",
|
||||
"href",
|
||||
"modifier"
|
||||
"modifier",
|
||||
"data-cy"
|
||||
],
|
||||
"ignore": ["Ansible", "Tower", "JSON", "YAML", "lg"],
|
||||
"ignoreComponent": [
|
||||
|
||||
@ -136,7 +136,7 @@ describe('<ScheduleEdit />', () => {
|
||||
resource={{
|
||||
id: 700,
|
||||
type: 'job_template',
|
||||
iventory: 1,
|
||||
inventory: 1,
|
||||
summary_fields: {
|
||||
credentials: [
|
||||
{ name: 'job template credential', id: 75, kind: 'ssh' },
|
||||
|
||||
@ -157,7 +157,7 @@ function CredentialFormFields({ i18n, initialTypeId, credentialTypes }) {
|
||||
<SelectOption
|
||||
key={credType.value}
|
||||
value={credType.value}
|
||||
dataCy={`${credType.id}-credential-type-select-option`}
|
||||
data-cy={`${credType.id}-credential-type-select-option`}
|
||||
>
|
||||
{credType.label}
|
||||
</SelectOption>
|
||||
|
||||
@ -90,14 +90,13 @@ describe('<InventoryDetail />', () => {
|
||||
expectDetailToMatch(wrapper, 'Name', mockInventory.name);
|
||||
expectDetailToMatch(wrapper, 'Description', mockInventory.description);
|
||||
expectDetailToMatch(wrapper, 'Type', 'Inventory');
|
||||
const link = wrapper.find('Detail[label="Organization"]').find('Link');
|
||||
|
||||
const org = wrapper.find('Detail[label="Organization"]');
|
||||
expect(org.prop('value')).toMatchInlineSnapshot(`
|
||||
<Link
|
||||
to="/organizations/1/details"
|
||||
>
|
||||
The Organization
|
||||
</Link>
|
||||
`);
|
||||
|
||||
expect(link.prop('to')).toEqual('/organizations/1/details');
|
||||
expect(org.length).toBe(1);
|
||||
|
||||
const vars = wrapper.find('VariablesDetail');
|
||||
expect(vars).toHaveLength(1);
|
||||
expect(vars.prop('value')).toEqual(mockInventory.variables);
|
||||
|
||||
@ -131,12 +131,12 @@ function AWXLogin({ alt, i18n, isAuthenticated }) {
|
||||
}
|
||||
|
||||
const HeaderBrand = (
|
||||
<Brand dataCy="brand-logo" src={logo} alt={alt || brandName} />
|
||||
<Brand data-cy="brand-logo" src={logo} alt={alt || brandName} />
|
||||
);
|
||||
const Header = <LoginHeader headerBrand={HeaderBrand} />;
|
||||
const Footer = (
|
||||
<LoginFooter
|
||||
dataCy="login-footer"
|
||||
data-cy="login-footer"
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: sanitizeHtml(loginInfo),
|
||||
}}
|
||||
@ -146,7 +146,7 @@ function AWXLogin({ alt, i18n, isAuthenticated }) {
|
||||
return (
|
||||
<Login header={Header} footer={Footer}>
|
||||
<LoginMainHeader
|
||||
dataCy="login-header"
|
||||
data-cy="login-header"
|
||||
title={
|
||||
brandName
|
||||
? i18n._(t`Welcome to Ansible ${brandName}! Please Sign In.`)
|
||||
@ -163,7 +163,7 @@ function AWXLogin({ alt, i18n, isAuthenticated }) {
|
||||
>
|
||||
{formik => (
|
||||
<LoginForm
|
||||
dataCy="login-form"
|
||||
data-cy="login-form"
|
||||
className={authError ? 'pf-m-error' : ''}
|
||||
helperText={helperText}
|
||||
isLoginButtonDisabled={isAuthenticating}
|
||||
@ -193,7 +193,7 @@ function AWXLogin({ alt, i18n, isAuthenticated }) {
|
||||
variant="error"
|
||||
title={i18n._(t`Error!`)}
|
||||
onClose={dismissLoginInfoError}
|
||||
dataCy="login-info-error"
|
||||
data-cy="login-info-error"
|
||||
>
|
||||
{i18n._(
|
||||
t`Failed to fetch custom login configuration settings. System defaults will be shown instead.`
|
||||
@ -211,7 +211,7 @@ function AWXLogin({ alt, i18n, isAuthenticated }) {
|
||||
if (authKey === 'azuread-oauth2') {
|
||||
return (
|
||||
<LoginMainFooterLinksItem
|
||||
dataCy="social-auth-azure"
|
||||
data-cy="social-auth-azure"
|
||||
href={loginUrl}
|
||||
key={authKey}
|
||||
>
|
||||
@ -224,7 +224,7 @@ function AWXLogin({ alt, i18n, isAuthenticated }) {
|
||||
if (authKey === 'github') {
|
||||
return (
|
||||
<LoginMainFooterLinksItem
|
||||
dataCy="social-auth-github"
|
||||
data-cy="social-auth-github"
|
||||
href={loginUrl}
|
||||
key={authKey}
|
||||
>
|
||||
@ -237,7 +237,7 @@ function AWXLogin({ alt, i18n, isAuthenticated }) {
|
||||
if (authKey === 'github-org') {
|
||||
return (
|
||||
<LoginMainFooterLinksItem
|
||||
dataCy="social-auth-github-org"
|
||||
data-cy="social-auth-github-org"
|
||||
href={loginUrl}
|
||||
key={authKey}
|
||||
>
|
||||
@ -252,7 +252,7 @@ function AWXLogin({ alt, i18n, isAuthenticated }) {
|
||||
if (authKey === 'github-team') {
|
||||
return (
|
||||
<LoginMainFooterLinksItem
|
||||
dataCy="social-auth-github-team"
|
||||
data-cy="social-auth-github-team"
|
||||
href={loginUrl}
|
||||
key={authKey}
|
||||
>
|
||||
@ -265,7 +265,7 @@ function AWXLogin({ alt, i18n, isAuthenticated }) {
|
||||
if (authKey === 'github-enterprise') {
|
||||
return (
|
||||
<LoginMainFooterLinksItem
|
||||
dataCy="social-auth-github-enterprise"
|
||||
data-cy="social-auth-github-enterprise"
|
||||
href={loginUrl}
|
||||
key={authKey}
|
||||
>
|
||||
@ -280,7 +280,7 @@ function AWXLogin({ alt, i18n, isAuthenticated }) {
|
||||
if (authKey === 'github-enterprise-org') {
|
||||
return (
|
||||
<LoginMainFooterLinksItem
|
||||
dataCy="social-auth-github-enterprise-org"
|
||||
data-cy="social-auth-github-enterprise-org"
|
||||
href={loginUrl}
|
||||
key={authKey}
|
||||
>
|
||||
@ -297,7 +297,7 @@ function AWXLogin({ alt, i18n, isAuthenticated }) {
|
||||
if (authKey === 'github-enterprise-team') {
|
||||
return (
|
||||
<LoginMainFooterLinksItem
|
||||
dataCy="social-auth-github-enterprise-team"
|
||||
data-cy="social-auth-github-enterprise-team"
|
||||
href={loginUrl}
|
||||
key={authKey}
|
||||
>
|
||||
@ -314,7 +314,7 @@ function AWXLogin({ alt, i18n, isAuthenticated }) {
|
||||
if (authKey === 'google-oauth2') {
|
||||
return (
|
||||
<LoginMainFooterLinksItem
|
||||
dataCy="social-auth-google"
|
||||
data-cy="social-auth-google"
|
||||
href={loginUrl}
|
||||
key={authKey}
|
||||
>
|
||||
@ -328,7 +328,7 @@ function AWXLogin({ alt, i18n, isAuthenticated }) {
|
||||
const samlIDP = authKey.split(':')[1] || null;
|
||||
return (
|
||||
<LoginMainFooterLinksItem
|
||||
dataCy="social-auth-saml"
|
||||
data-cy="social-auth-saml"
|
||||
href={loginUrl}
|
||||
key={authKey}
|
||||
>
|
||||
|
||||
@ -53,7 +53,7 @@ describe('<Metrics/>', () => {
|
||||
.prop('onClick')({}, 'instance 1');
|
||||
});
|
||||
wrapper.update();
|
||||
await act(() => {
|
||||
await act(async () => {
|
||||
wrapper.find('Select[ouiaId="Metric-select"]').prop('onToggle')(true);
|
||||
});
|
||||
wrapper.update();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user