@@ -985,3 +985,61 @@ describe('Contributors', function () {
985
985
cy . get ( '#contributor_2_givenName' ) . should ( 'have.value' , 'Joe' ) ;
986
986
} ) ;
987
987
} ) ;
988
+
989
+ describe ( 'One contributor with a role' , function ( ) {
990
+ it ( 'can be exported in both codemeta v2.0 and v3.0 versions' , function ( ) {
991
+ cy . get ( '#name' ) . type ( 'My Test Software' ) ;
992
+
993
+ cy . get ( '#contributor_add' ) . click ( ) ;
994
+ cy . get ( '#contributor_1_givenName' ) . type ( 'Jane' ) ;
995
+
996
+ cy . get ( '#contributor_1_role_add' ) . click ( ) ;
997
+ cy . get ( '#contributor_1_roleName_0' ) . type ( 'Developer' ) ;
998
+ cy . get ( '#contributor_1_startDate_0' ) . type ( '2024-03-04' ) ;
999
+ cy . get ( '#contributor_1_endDate_0' ) . type ( '2024-04-03' ) ;
1000
+
1001
+ cy . get ( '#generateCodemetaV2' ) . click ( ) ;
1002
+ cy . get ( '#codemetaText' ) . then ( ( elem ) => JSON . parse ( elem . text ( ) ) )
1003
+ . should ( 'deep.equal' , {
1004
+ "@context" : "https://doi.org/10.5063/schema/codemeta-2.0" ,
1005
+ "type" : "SoftwareSourceCode" ,
1006
+ "name" : "My Test Software" ,
1007
+ "contributor" : [
1008
+ {
1009
+ "id" : "_:contributor_1" ,
1010
+ "type" : "Person" ,
1011
+ "givenName" : "Jane"
1012
+ } ,
1013
+ {
1014
+ "type" : "schema:Role" ,
1015
+ "contributor" : "_:contributor_1" ,
1016
+ "schema:roleName" : "Developer" ,
1017
+ "schema:startDate" : "2024-03-04" ,
1018
+ "schema:endDate" : "2024-04-03"
1019
+ }
1020
+ ]
1021
+ } ) ;
1022
+
1023
+ cy . get ( '#generateCodemetaV3' ) . click ( ) ;
1024
+ cy . get ( '#codemetaText' ) . then ( ( elem ) => JSON . parse ( elem . text ( ) ) )
1025
+ . should ( 'deep.equal' , {
1026
+ "@context" : "https://w3id.org/codemeta/3.0" ,
1027
+ "type" : "SoftwareSourceCode" ,
1028
+ "name" : "My Test Software" ,
1029
+ "contributor" : [
1030
+ {
1031
+ "id" : "_:contributor_1" ,
1032
+ "type" : "Person" ,
1033
+ "givenName" : "Jane"
1034
+ } ,
1035
+ {
1036
+ "type" : "Role" ,
1037
+ "contributor" : "_:contributor_1" ,
1038
+ "roleName" : "Developer" ,
1039
+ "startDate" : "2024-03-04" ,
1040
+ "endDate" : "2024-04-03"
1041
+ }
1042
+ ]
1043
+ } ) ;
1044
+ } ) ;
1045
+ } ) ;
0 commit comments