Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(jest): update describe on tests #4435

Merged
merged 2 commits into from
Aug 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libraries/BlockchainClient/BlockchainClient.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import BlockchainClient from './BlockchainClient'

describe('', () => {
describe('Test BlockchainClient', () => {
test('get account but it is uninitialized', () => {
const $BlockchainClient: BlockchainClient = BlockchainClient.getInstance()
try {
Expand Down
2 changes: 1 addition & 1 deletion libraries/Crypto/Crypto.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Keypair } from '@solana/web3.js'
import Crypto from './Crypto'

describe('', () => {
describe('Test crypto', () => {
test('Initialize Crypto', () => {
const exampleKeypair = Keypair.generate()
const konstruktor = new Crypto()
Expand Down
2 changes: 1 addition & 1 deletion libraries/Iridium/IdentityManager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('Test seedFromWallet', () => {
})

describe('Test seedFromPrivateKey', () => {
it('should return an error: Incorrect signature hash size', async () => {
it('throws on invalid private key length', async () => {
const localParam = {
passphrase: 'string',
privateKey: new Uint8Array(
Expand Down
2 changes: 1 addition & 1 deletion libraries/Solana/UsersProgram/UsersProgram.types.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { IDL } from '~/libraries/Solana/UsersProgram/UsersProgram.types'

describe('', () => {
describe('Test UsersProgram types', () => {
test('check IDL export type', () => {
expect(IDL).toEqual({
version: '0.1.0',
Expand Down
2 changes: 1 addition & 1 deletion store/meta/mutations.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { MetaState } from './types'
import * as meta from '~/store/meta/mutations'

describe('', () => {
describe('Test meta mutations', () => {
let inst: any
const state: MetaState = {
title: 'empty title',
Expand Down
4 changes: 2 additions & 2 deletions utilities/EXIF.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as exif from './EXIF'

describe('', () => {
test('file is jpeg', async () => {
describe('Tests exif', () => {
test('given file is jpeg', async () => {
const jpegBlob = new Blob(['testing'], { type: 'image/jpeg' })

// const file2 = new Fil({ ...mockFileData, name: 'testPng2.png' })
Expand Down
30 changes: 15 additions & 15 deletions utilities/Messaging.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ const initialRootState: any = {
},
}

describe('', () => {
test('getFullUserInfoFromState with identical textile public key', () => {
describe('Test Messaging', () => {
it('calls getFullUserInfoFromState with identical textile public key', () => {
const rootStateForTest = { ...initialRootState }
const publicKeyForTest = 'publickey1'
rootStateForTest.accounts.details.textilePubkey = publicKeyForTest
Expand All @@ -156,7 +156,7 @@ describe('', () => {
expect(result).toBe(rootStateForTest.accounts.details)
})

test('getFullUserInfoFromState with non-identical textile public key', () => {
it('calls getFullUserInfoFromState with non-identical textile public key', () => {
const rootStateForTest = { ...initialRootState }
const publicKeyForTest =
'https://accounts.google.com/o/oauth2/revoke?token=%s'
Expand Down Expand Up @@ -194,7 +194,7 @@ describe('', () => {
})
})

test('getUsernameFromState with unknown textile public key', () => {
it('calls getUsernameFromState with unknown textile public key', () => {
const rootStateForTest = { ...initialRootState }
const publicKeyForTest = 'publickey1'
rootStateForTest.accounts.details.textilePubkey = publicKeyForTest
Expand All @@ -207,7 +207,7 @@ describe('', () => {
expect(result).toBe(PropCommonEnum.UNKNOWN)
})

test('getAddressFromState with unknown textile public key', () => {
it('calls getAddressFromState with unknown textile public key', () => {
const rootStateForTest = { ...initialRootState }
const publicKeyForTest = 'publickey1'
rootStateForTest.accounts.details.textilePubkey = publicKeyForTest
Expand All @@ -220,7 +220,7 @@ describe('', () => {
expect(result).toBe(PropCommonEnum.UNKNOWN)
})

test('refreshTimeStampInterval', () => {
it('calls refreshTimeStampInterval', () => {
jest.useFakeTimers()
const action = jest.fn()
const result1 = Messaging.refreshTimestampInterval(123, action, 3000)
Expand All @@ -229,7 +229,7 @@ describe('', () => {
expect(result2).toBe(1000000000001)
})

test('replyMessageToUIReply', () => {
it('calls replyMessageToUIReply', () => {
const result: UIReply = Messaging.exportedForTesting.replyMessageToUIReply(
[
{
Expand All @@ -256,7 +256,7 @@ describe('', () => {
expect(result).toMatchSnapshot()
})

test('messageRepliesToUIReplies', () => {
it('calls messageRepliesToUIReplies', () => {
const result = Messaging.exportedForTesting.messageRepliesToUIReplies(
[
{
Expand Down Expand Up @@ -292,7 +292,7 @@ describe('', () => {
expect(result).toMatchSnapshot()
})

test('groupMessages', () => {
it('calls groupMessages', () => {
const message1 = `message1`
const message2 = `message2`
const reaction1 = `reaction1`
Expand Down Expand Up @@ -336,7 +336,7 @@ describe('', () => {
})

describe('update message tracker', () => {
test('updateMessageTracker glyph', () => {
it('calls updateMessageTracker glyph', () => {
const newMessages = [
{
replyMessage: 'text0',
Expand All @@ -360,7 +360,7 @@ describe('update message tracker', () => {
expect(result).toMatchSnapshot()
})

test('updateMessageTracker text', () => {
it('calls updateMessageTracker text', () => {
const newMessages = [
{
replyMessage: 'text0',
Expand All @@ -384,7 +384,7 @@ describe('update message tracker', () => {
expect(result).toMatchSnapshot()
})

test('updateMessageTracker file', () => {
it('calls updateMessageTracker file', () => {
const newMessages = [
{
replyMessage: 'text0',
Expand All @@ -408,7 +408,7 @@ describe('update message tracker', () => {
expect(result).toMatchSnapshot()
})

test('updateMessageTracker reaction', () => {
it('calls updateMessageTracker reaction', () => {
const newMessages = [
{
replyMessage: 'text0',
Expand All @@ -432,7 +432,7 @@ describe('update message tracker', () => {
expect(result).toMatchSnapshot()
})

test('updateMessageTracker reply', () => {
it('calls updateMessageTracker reply', () => {
const newMessages = [
{
replyMessage: 'text0',
Expand All @@ -456,7 +456,7 @@ describe('update message tracker', () => {
expect(result).toMatchSnapshot()
})

test('convertTimestampToDate', () => {
it('calls convertTimestampToDate', () => {
const localTimestamp = dateNow
const result = Messaging.convertTimestampToDate(
{
Expand Down
2 changes: 1 addition & 1 deletion utilities/Thumbnail.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as Thumbnail from './Thumbnail'

const ThumbnailDefault = Thumbnail.default

describe('', () => {
describe('Test thumbnail', () => {
test('txt thumbnail', async () => {
const testFile = new File(['hello'], 'test_fil.txt', {
type: 'text/plain',
Expand Down
16 changes: 8 additions & 8 deletions utilities/__snapshots__/Messaging.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[` messageRepliesToUIReplies 1`] = `
exports[`Test Messaging calls messageRepliesToUIReplies 1`] = `
Array [
Object {
"fileMessage": "",
Expand All @@ -25,7 +25,7 @@ Array [
]
`;

exports[` replyMessageToUIReply 1`] = `
exports[`Test Messaging calls replyMessageToUIReply 1`] = `
Object {
"0": Object {
"fileMessage": "",
Expand Down Expand Up @@ -55,9 +55,9 @@ Object {
}
`;

exports[`update message tracker convertTimestampToDate 1`] = `"L"`;
exports[`update message tracker calls convertTimestampToDate 1`] = `"L"`;

exports[`update message tracker updateMessageTracker file 1`] = `
exports[`update message tracker calls updateMessageTracker file 1`] = `
Object {
"messages": Object {
"undefined": Object {
Expand All @@ -75,7 +75,7 @@ Object {
}
`;

exports[`update message tracker updateMessageTracker glyph 1`] = `
exports[`update message tracker calls updateMessageTracker glyph 1`] = `
Object {
"messages": Object {
"undefined": Object {
Expand All @@ -93,7 +93,7 @@ Object {
}
`;

exports[`update message tracker updateMessageTracker reaction 1`] = `
exports[`update message tracker calls updateMessageTracker reaction 1`] = `
Object {
"messages": Object {},
"reactions": Object {
Expand All @@ -113,7 +113,7 @@ Object {
}
`;

exports[`update message tracker updateMessageTracker reply 1`] = `
exports[`update message tracker calls updateMessageTracker reply 1`] = `
Object {
"messages": Object {},
"reactions": Object {},
Expand All @@ -133,7 +133,7 @@ Object {
}
`;

exports[`update message tracker updateMessageTracker text 1`] = `
exports[`update message tracker calls updateMessageTracker text 1`] = `
Object {
"messages": Object {
"undefined": Object {
Expand Down
2 changes: 1 addition & 1 deletion utilities/__snapshots__/Thumbnail.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[` txt thumbnail 1`] = `undefined`;
exports[`Test thumbnail txt thumbnail 1`] = `undefined`;