MCPcopy
hub / github.com/bugy/script-server / testValidation

Function testValidation

web-src/tests/unit/textfield_test.js:222–232  ·  view source on GitHub ↗
(textfield, type, value, expectedError)

Source from the content-addressed store, hash-verified

220 describe('Test IP validaton', function () {
221
222 async function testValidation(textfield, type, value, expectedError) {
223 setDeepProp(textfield, 'config.type', type);
224 textfield.setProps({value: value});
225 await vueTicks();
226
227 if (isEmptyString(expectedError)) {
228 expect(textfield.currentError).toBe(expectedError)
229 } else {
230 expect(textfield.currentError).toInclude(expectedError)
231 }
232 }
233
234 it('Test IPv4 127.0.0.1', async function () {
235 await testValidation(this.textfield, 'ip4', '127.0.0.1', '')

Callers 1

textfield_test.jsFile · 0.85

Calls 3

setDeepPropFunction · 0.90
vueTicksFunction · 0.90
isEmptyStringFunction · 0.90

Tested by

no test coverage detected