Skip to content

Commit

Permalink
feat: add tests for template
Browse files Browse the repository at this point in the history
  • Loading branch information
tushar5526 committed Jul 11, 2023
1 parent 379d198 commit 098606a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions services/credential-schema/src/schema/schema.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ describe('SchemaService', () => {
expect(updatedSchema).toBeDefined();
expect(updatedSchema.tags).toEqual(['test1', 'test2']);
expect(updatedSchema.schema.version).toBe('1.1.0');
expect(updatedSchema.status).toBe('DRAFT');
expect(updatedSchema.status).toBe('PUBLISHED');
});
it('should try updating the schema fields of a DRAFT Schema', async () => {
const didBody = generateTestDIDBody();
Expand Down Expand Up @@ -174,7 +174,7 @@ describe('SchemaService', () => {

expect(updatedSchema).toBeDefined();
expect(updatedSchema.schema.version).toBe('2.0.0');
expect(updatedSchema.status).toBe('DRAFT');
expect(updatedSchema.status).toBe('PUBLISHED');
expect(updatedSchema.schema.author).toBe(pschema.schema.id);
});
});
4 changes: 1 addition & 3 deletions services/credential-schema/src/schema/schema.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,11 +385,9 @@ export class SchemaService {
newStatus = SchemaStatus.REVOKED;
break;
case 'DRAFT':
newStatus = SchemaStatus.REVOKED;
newStatus = SchemaStatus.DRAFT;
break;
default:
// newStatus = SchemaStatus.DRAFT;
Logger.warn('Unknown schema status, setting to draft');
throw new BadRequestException(
'Invalid status value. Supported values are: 1. DRAFT 2. DEPRECATED 3. REVOKED 4. PUBLISHED',
);
Expand Down

0 comments on commit 098606a

Please sign in to comment.