Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,32 @@ describe('validateStoreProps', () => {
);
});

it('does not log missing parameters error when prefix is empty string', () => {
const locationWithEmptyPrefix = {
...location,
prefix: '', // Empty string should be valid for bucket root access
};

validateStoreProps({
value: { location: locationWithEmptyPrefix },
onValueChange: jest.fn(),
});

expect(consoleErrorSpy).toHaveBeenCalledTimes(0);
});

it('logs missing parameters error when prefix is undefined', () => {
validateStoreProps({
// @ts-expect-error force invalid location
value: { location: { ...location, prefix: undefined } },
onValueChange: jest.fn(),
});

const expected = [MISSING_REQUIRED, '`prefix`'];
expect(consoleErrorSpy).toHaveBeenCalledTimes(1);
expect(consoleErrorSpy).toHaveBeenCalledWith(...expected);
});

it('logs the expected message on change between controlled and uncontrolled mode once', () => {
validateStoreProps({ value: null });
validateStoreProps({});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ const getMissingLocationKeys = (
) =>
location === null
? []
: REQUIRED_LOCATION_KEYS.filter((key) => !location[key]);
: REQUIRED_LOCATION_KEYS.filter(
(key) => location[key] === undefined || location[key] === null
);

let didWarnConflictingBehavior = false;
let didWarnDeprecatedAndConflictingProps = false;
Expand Down
Loading