Browse Source

fix(nc-gui): refactor validator

pull/7569/head
DarkPhoenix2704 11 months ago
parent
commit
dc8bc67b48
  1. 10
      packages/nc-gui/utils/validation.ts
  2. 2
      tests/playwright/pages/Account/Authentication.ts

10
packages/nc-gui/utils/validation.ts

@ -208,3 +208,13 @@ export const emailValidator = {
}) })
}, },
} }
export const urlValidator = {
validator: (_: unknown, v: string) => {
return new Promise((resolve, reject) => {
if (!v.length || isValidURL(v)) return resolve()
reject(new Error(t('msg.error.invalidURL')))
})
},
}

2
tests/playwright/pages/Account/Authentication.ts

@ -138,7 +138,7 @@ export class AccountAuthenticationPage extends BasePage {
await oidcModal.locator('[data-test-id="nc-oidc-client-secret"]').fill(p.clientSecret); await oidcModal.locator('[data-test-id="nc-oidc-client-secret"]').fill(p.clientSecret);
await oidcModal.locator('[data-test-id="nc-oidc-authUrl"]').fill(p.authUrl); await oidcModal.locator('[data-test-id="nc-oidc-auth-url"]').fill(p.authUrl);
await oidcModal.locator('[data-test-id="nc-oidc-tokenUrl"]').fill(p.tokenUrl); await oidcModal.locator('[data-test-id="nc-oidc-tokenUrl"]').fill(p.tokenUrl);

Loading…
Cancel
Save