Skip to content

Commit

Permalink
test/remove-duplicate-tests-titles
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-seitz-uniswap committed Apr 19, 2024
1 parent 8735925 commit 8a89993
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 18 deletions.
14 changes: 3 additions & 11 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,12 @@
"plugin:@typescript-eslint/recommended"
],
"rules": {
"@typescript-eslint/no-this-alias": [
"error",
{
"allowDestructuring": true, // Allow `const { props, state } = this`; false by default
"allowedNames": [
"self" // Allow `const self= this`; `[]` by default
]
}
],
"@typescript-eslint/no-this-alias": "error",
"@typescript-eslint/ban-types": "warn",
"jest/no-disabled-tests": "warn",
"jest/no-focused-tests": "error",
"jest/no-identical-title": "warn",
"jest/prefer-to-have-length": "warn",
"jest/no-identical-title": "error",
"jest/prefer-to-have-length": "error",
"jest/valid-expect": "error"
}
}
2 changes: 1 addition & 1 deletion test/integ/repositories/dynamo-repository.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ describe('OrdersRepository getOrders test', () => {
expect(queryResult.orders[0]).toEqual(expect.objectContaining(MOCK_ORDER_3))
})

it('should return no orders for chainId and orderStatus', async () => {
it('should return no orders for chainId, orderStatus, filler, when none match', async () => {
const orders = await ordersRepository.getOrders(10, { chainId: 137, orderStatus: ORDER_STATUS.OPEN, filler: '0x3' })
expect(orders.orders).toEqual([])
})
Expand Down
2 changes: 1 addition & 1 deletion test/integ/repositories/limit-orders-repository.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ describe('OrdersRepository getOrders test', () => {
expect(queryResult.orders[0]).toEqual(expect.objectContaining(MOCK_ORDER_3))
})

it('should return no orders for chainId and orderStatus', async () => {
it('should return no orders for chainId, orderStatus, filler, when none match', async () => {
const orders = await ordersRepository.getOrders(10, { chainId: 137, orderStatus: ORDER_STATUS.OPEN, filler: '0x3' })
expect(orders.orders).toEqual([])
})
Expand Down
4 changes: 2 additions & 2 deletions test/unit/services/check-order-status/util.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { calculateDutchRetryWaitSeconds } from '../../../../lib/handlers/check-order-status/util'

describe('calculateDutchRetryWaitSeconds', () => {
it('should do exponential backoff when retry count > 300', async () => {
it('should do exponential backoff when retry count > 300, retryCount:301', async () => {
const response = calculateDutchRetryWaitSeconds(1, 301)
expect(response).toEqual(13)
})

it('should do exponential backoff when retry count > 300', async () => {
it('should do exponential backoff when retry count > 300, retryCount:350', async () => {
const response = calculateDutchRetryWaitSeconds(1, 350)
expect(response).toEqual(138)
})
Expand Down
6 changes: 3 additions & 3 deletions test/unit/util/field-validator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,20 +175,20 @@ describe('Testing each field on the FieldValidator class.', () => {
})
})

describe('Testing cursor field.', () => {
describe('Testing cursor field', () => {
it('should validate field.', async () => {
const cursor = 'eyJvcmRlckhhc2giOiIweGRlYWRiZWVmNTcxNDAzIn0='
expect(FieldValidator.isValidCursor().validate(cursor)).toEqual({ value: cursor })
})

it('should invalidate field.', async () => {
it('should invalidate field with invalid cursor', async () => {
const invalidCursor = '0xnot_a_valid_order_$$$$'
const validatedField = FieldValidator.isValidCursor().validate(invalidCursor)
expect(validatedField.error).toBeTruthy()
expect(validatedField.error?.details[0].message).toEqual('"value" must be a valid base64 string')
})

it('should invalidate field.', async () => {
it('should invalidate field with maxLength cursor', async () => {
const maxLengthCursor = `jfkasdjfkdsajfdjsafjdsjfkljsddkfjdhsajkgfhdgjkdfshgkfhdjkghjkfdhgjkh
hsdfjhgjkfdshgjksdfjkgfdjkshgjkhsdfjkghfdjkghjkfdshgjklhdfsjkghkjfdshg
hsdfjhgjkfdshgjksdfjkgfdjkshgjkhsdfjkghfdjkghjkfdshgjklhdfsjkghkjfdshg
Expand Down

0 comments on commit 8a89993

Please sign in to comment.