Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F3010192
pick-from-list.test.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
602 B
Referenced Files
None
Subscribers
None
pick-from-list.test.ts
View Options
import
assert
from
"assert"
;
import
{
Fields
}
from
"../../index.js"
;
describe
(
"pick-from-list field"
,
()
=>
{
const
ctx
=
{}
as
any
;
it
(
"validation logic"
,
async
()
=>
{
const
field
=
new
Fields
.
PickFromListField
(
true
,
async
()
=>
{
return
[
{
value
:
"samplev"
,
label
:
"samplel"
},
{
value
:
"samplevv"
,
label
:
"samplell"
},
];
});
assert
.
strictEqual
((
await
field
.
isValueValid
(
ctx
,
42
as
any
)).
valid
,
false
);
assert
.
strictEqual
((
await
field
.
isValueValid
(
ctx
,
"samplevv"
)).
valid
,
true
);
assert
.
strictEqual
((
await
field
.
isValueValid
(
ctx
,
"notvalid"
)).
valid
,
false
);
});
});
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Wed, May 7, 19:37 (1 d, 21 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
625897
Default Alt Text
pick-from-list.test.ts (602 B)
Attached To
Mode
rSGEN sealgen
Attached
Detach File
Event Timeline
Log In to Comment