Skip to content

Commit

Permalink
refactor: add prettier, rectify procedureTypes without hardcode string
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Wiebe committed Nov 21, 2019
1 parent 35bfeb8 commit c7a5889
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
10 changes: 8 additions & 2 deletions src/procedures/__tests__/AssignSecurityTokenRole.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ import * as tokenFactoryModule from '../../testUtils/MockedTokenFactoryModule';
import { AssignSecurityTokenRole } from '../../procedures/AssignSecurityTokenRole';
import { Procedure } from '../Procedure';
import { PolymathError } from '../../PolymathError';
import { ErrorCode, Feature, PolyTransactionTag, SecurityTokenRole } from '../../types';
import {
ErrorCode,
Feature,
PolyTransactionTag,
ProcedureType,
SecurityTokenRole,
} from '../../types';
import * as securityTokenFactoryModule from '../../entities/factories/SecurityTokenFactory';
import { mockFactories } from '../../testUtils/mockFactories';

Expand Down Expand Up @@ -76,7 +82,7 @@ describe('AssignSecurityTokenRole', () => {
describe('Types', () => {
test('should extend procedure and have AssignSecurityTokenRole type', async () => {
expect(target instanceof Procedure).toBe(true);
expect(target.type).toBe('AssignSecurityTokenRole');
expect(target.type).toBe(ProcedureType.AssignSecurityTokenRole);
});
});

Expand Down
4 changes: 2 additions & 2 deletions src/procedures/__tests__/AssignStoRole.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as tokenFactoryModule from '../../testUtils/MockedTokenFactoryModule';
import { AssignStoRole } from '../../procedures/AssignStoRole';
import { Procedure } from '../Procedure';
import { PolymathError } from '../../PolymathError';
import { ErrorCode, PolyTransactionTag, StoRole } from '../../types';
import { ErrorCode, PolyTransactionTag, ProcedureType, StoRole } from '../../types';

const params = {
symbol: 'TEST1',
Expand Down Expand Up @@ -46,7 +46,7 @@ describe('AssignStoRole', () => {
describe('Types', () => {
test('should extend procedure and have AssignStoRole type', async () => {
expect(target instanceof Procedure).toBe(true);
expect(target.type).toBe('AssignStoRole');
expect(target.type).toBe(ProcedureType.AssignStoRole);
});
});

Expand Down
4 changes: 2 additions & 2 deletions src/procedures/__tests__/EnableDividendManagers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as tokenFactoryModule from '../../testUtils/MockedTokenFactoryModule';
import { EnableDividendManagers } from '../../procedures/EnableDividendManagers';
import { Procedure } from '../Procedure';
import { PolymathError } from '../../PolymathError';
import { ErrorCode, PolyTransactionTag } from '../../types';
import { ErrorCode, PolyTransactionTag, ProcedureType } from '../../types';

const params = {
symbol: 'TEST1',
Expand Down Expand Up @@ -57,7 +57,7 @@ describe('EnableDividendManagers', () => {
describe('Types', () => {
test('should extend procedure and have EnableDividendManagers type', async () => {
expect(target instanceof Procedure).toBe(true);
expect(target.type).toBe('EnableDividendManagers');
expect(target.type).toBe(ProcedureType.EnableDividendManagers);
});
});

Expand Down
4 changes: 2 additions & 2 deletions src/procedures/__tests__/EnableGeneralPermissionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as tokenFactoryModule from '../../testUtils/MockedTokenFactoryModule';
import { EnableGeneralPermissionManager } from '../../procedures/EnableGeneralPermissionManager';
import { Procedure } from '../Procedure';
import { PolymathError } from '../../PolymathError';
import { ErrorCode, PolyTransactionTag } from '../../types';
import { ErrorCode, PolyTransactionTag, ProcedureType } from '../../types';

const params = {
symbol: 'TEST1',
Expand Down Expand Up @@ -56,7 +56,7 @@ describe('EnableGeneralPermissionManager', () => {
describe('Types', () => {
test('should extend procedure and have EnableGeneralPermissionManager type', async () => {
expect(target instanceof Procedure).toBe(true);
expect(target.type).toBe('EnableGeneralPermissionManager');
expect(target.type).toBe(ProcedureType.EnableGeneralPermissionManager);
});
});

Expand Down
1 change: 1 addition & 0 deletions src/procedures/__tests__/PauseSto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ describe('PauseSto', () => {
// Instantiate PauseSto
target = new PauseSto(cappedParams, contextMock.getMockInstance());
});

afterEach(() => {
restore();
});
Expand Down

0 comments on commit c7a5889

Please sign in to comment.