Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(editors/connectedap-editor): move wizards to wizard library #448

Merged
merged 8 commits into from
Jan 12, 2022
1 change: 1 addition & 0 deletions src/wizards/connectedap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ export function editConnectedApWizard(element: Element): Wizard {
>${getTypes(element).map(
ptype =>
html`<wizard-textfield
required
JakobVogelsang marked this conversation as resolved.
Show resolved Hide resolved
label="${ptype}"
pattern="${ifDefined(typePattern[ptype])}"
?nullable=${typeNullable[ptype]}
Expand Down
11 changes: 11 additions & 0 deletions test/foundation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
import fc, { Arbitrary, array, hexaString, integer, tuple } from 'fast-check';
import { patterns } from '../src/foundation.js';

export function negativeRegex(
JakobVogelsang marked this conversation as resolved.
Show resolved Hide resolved
re: RegExp,
minLength = 0,
maxLength?: number
): Arbitrary<string> {
return fc
.string({ minLength, maxLength: maxLength ?? 2 * minLength + 10 })
.filter(char => !re.test(char));
}

export function regexString(
re: RegExp,
minLength = 0,
Expand Down Expand Up @@ -36,6 +46,7 @@ export const regExp = {
tName: new RegExp(`^${patterns.normalizedString}$`),
desc: new RegExp(`^${patterns.normalizedString}$`),
IPv4: /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/,
IPv6: /^([0-9A-F]{2}-){5}[0-9A-F]{2}$/,
OSI: /^[0-9A-F]+$/,
OSIAPi: /^[0-9\u002C]+$/,
OSIid: /^[0-9]+$/,
Expand Down
Loading