Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F10352574
color.test.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
color.test.ts
View Options
import
assert
from
"assert"
;
import
{
Color
}
from
"./color.js"
;
import
{
makeSimpleEnglishJDDContext
}
from
"../jdd-context.js"
;
describe
(
"color argument"
,
()
=>
{
it
(
"properly parses arguments of length 4"
,
async
()
=>
{
var
e
=
new
Color
();
const
response
=
await
e
.
receivedToParsed
(
makeSimpleEnglishJDDContext
(),
"#abc"
);
assert
.
deepStrictEqual
(
response
,
"#abc"
);
});
it
(
"properly parses arguments of length 7"
,
async
()
=>
{
var
e
=
new
Color
();
const
response
=
await
e
.
receivedToParsed
(
makeSimpleEnglishJDDContext
(),
"#abc123"
);
assert
.
deepStrictEqual
(
response
,
"#abc123"
);
});
it
(
"does not allow arguments with different length"
,
async
()
=>
{
var
e
=
new
Color
();
const
response
=
await
e
.
receivedToParsed
(
makeSimpleEnglishJDDContext
(),
"#abc1234"
);
assert
.
deepStrictEqual
(
response
,
"#000000"
);
const
response2
=
await
e
.
receivedToParsed
(
makeSimpleEnglishJDDContext
(),
"#abc12"
);
assert
.
deepStrictEqual
(
response2
,
"#000000"
);
});
it
(
"does not allow arguments with outside of [0-9][a-f]"
,
async
()
=>
{
var
e
=
new
Color
();
const
response
=
await
e
.
receivedToParsed
(
makeSimpleEnglishJDDContext
(),
"#qqq123"
);
assert
.
deepStrictEqual
(
response
,
"#000000"
);
});
});
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Sun, Nov 2, 16:57 (13 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1030447
Default Alt Text
color.test.ts (1 KB)
Attached To
Mode
rJDD jdd
Attached
Detach File
Event Timeline
Log In to Comment