Skip to content

Commit

Permalink
fix(typescript): jest tests and types
Browse files Browse the repository at this point in the history
  • Loading branch information
pac-guerreiro committed Mar 28, 2024
1 parent 8244501 commit 8fc529a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/libs/OptionsListUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2095,4 +2095,4 @@ export {
getTaxRatesSection,
};

export type {MemberForList, CategorySection, CategoryTreeSection, GetOptions, PayeePersonalDetails, Category, Tag};
export type {MemberForList, CategorySection, CategoryTreeSection, GetOptions, PayeePersonalDetails, Category};
4 changes: 2 additions & 2 deletions tests/e2e/compare/output/console.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ type Entry = {
type Data = {
significance: Entry[];
meaningless: Entry[];
errors: string[];
warnings: string[];
errors?: string[];
warnings?: string[];
};

const printRegularLine = (entry: Entry) => {
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/OptionsListUtilsTest.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-disable @typescript-eslint/naming-convention */
import type {OnyxCollection, OnyxEntry} from 'react-native-onyx';
import Onyx from 'react-native-onyx';
import type {SelectedTagOption} from '@components/TagPicker';
import CONST from '@src/CONST';
import type {Tag} from '@src/libs/OptionsListUtils';
import * as OptionsListUtils from '@src/libs/OptionsListUtils';
import * as ReportUtils from '@src/libs/ReportUtils';
import ONYXKEYS from '@src/ONYXKEYS';
Expand Down Expand Up @@ -1205,7 +1205,7 @@ describe('OptionsListUtils', () => {
name: 'Medical',
},
];
const smallTagsList: Record<string, Tag> = {
const smallTagsList: Record<string, SelectedTagOption> = {
Engineering: {
enabled: false,
name: 'Engineering',
Expand Down Expand Up @@ -1282,7 +1282,7 @@ describe('OptionsListUtils', () => {
data: [],
},
];
const largeTagsList: Record<string, Tag> = {
const largeTagsList: Record<string, SelectedTagOption> = {
Engineering: {
enabled: false,
name: 'Engineering',
Expand Down Expand Up @@ -2190,7 +2190,7 @@ describe('OptionsListUtils', () => {
});

it('sortTags', () => {
const createTagObjects = (names) => _.map(names, (name) => ({name, enabled: true}));
const createTagObjects = (names: string[]) => names.map((name) => ({name, enabled: true}));

const unorderedTagNames = ['10bc', 'b', '0a', '1', '中国', 'b10', '!', '2', '0', '@', 'a1', 'a', '3', 'b1', '日本', '$', '20', '20a', '#', 'a20', 'c', '10'];
const expectedOrderNames = ['!', '#', '$', '0', '0a', '1', '10', '10bc', '2', '20', '20a', '3', '@', 'a', 'a1', 'a20', 'b', 'b1', 'b10', 'c', '中国', '日本'];
Expand Down

0 comments on commit 8fc529a

Please sign in to comment.