11import { describe , it , expect } from 'vitest' ;
22
3- import { actorNameToToolName , toolNameToActorName } from '../src/actors.js' ;
3+ import { actorNameToToolName } from '../src/actors.js' ;
44
55describe ( 'actors' , ( ) => {
66 describe ( 'actorNameToToolName' , ( ) => {
@@ -20,24 +20,11 @@ describe('actors', () => {
2020 it ( 'should handle strings with multiple slashes and dots' , ( ) => {
2121 expect ( actorNameToToolName ( 'actor/name.with/multiple.parts' ) ) . toBe ( 'actor-slash-name-dot-with-slash-multiple-dot-parts' ) ;
2222 } ) ;
23- } ) ;
24-
25- describe ( 'toolNameToActorName' , ( ) => {
26- it ( 'should convert dash notation back to slashes and dots' , ( ) => {
27- expect ( toolNameToActorName ( 'apify-slash-web-scraper' ) ) . toBe ( 'apify/web-scraper' ) ;
28- expect ( toolNameToActorName ( 'my-dot-actor-dot-name' ) ) . toBe ( 'my.actor.name' ) ;
29- } ) ;
30-
31- it ( 'should handle empty strings' , ( ) => {
32- expect ( toolNameToActorName ( '' ) ) . toBe ( '' ) ;
33- } ) ;
34-
35- it ( 'should handle strings without dash notation' , ( ) => {
36- expect ( toolNameToActorName ( 'actorname' ) ) . toBe ( 'actorname' ) ;
37- } ) ;
3823
39- it ( 'should handle strings with multiple dash notations' , ( ) => {
40- expect ( toolNameToActorName ( 'actor-slash-name-dot-with-slash-multiple-dot-parts' ) ) . toBe ( 'actor/name.with/multiple.parts' ) ;
24+ it ( 'should handle tool names longer than 64 characters' , ( ) => {
25+ const longName = 'a' . repeat ( 70 ) ;
26+ const expected = 'a' . repeat ( 64 ) ;
27+ expect ( actorNameToToolName ( longName ) ) . toBe ( expected ) ;
4128 } ) ;
4229 } ) ;
4330} ) ;
0 commit comments