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: Picker - formatter settings #1907

Merged
merged 10 commits into from
Apr 3, 2024
6 changes: 2 additions & 4 deletions packages/jsapi-components/src/useGetItemIndexByValue.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe('useGetItemIndexByValue', () => {
}
);

it('should return null if seekRow fails', async () => {
it('should throw if seekRow fails', async () => {
asMock(mockTable.seekRow).mockRejectedValue('Some error');

const { result } = renderHook(() =>
Expand All @@ -65,9 +65,7 @@ describe('useGetItemIndexByValue', () => {
})
);

const actual = await result.current();

expect(actual).toBeNull();
expect(result.current()).rejects.toEqual('Some error');
});

it.each([
Expand Down
2 changes: 1 addition & 1 deletion packages/jsapi-components/src/useGetItemIndexByValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function useGetItemIndexByValue<TValue>({
return index === -1 ? null : index;
} catch (err) {
log.debug('Error seeking row', { column, value, columnValueType });
return null;
throw err;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't bother logging it either - consumer either catches it and logs it or does something with it in which case the log would be extra spam. If it's uncaught would be logged as an uncaught promise anyway.

}
}, [columnName, table, tableUtils, value]);
}
Expand Down
Loading