fix: test

This commit is contained in:
wuzihao051119 2025-05-23 23:57:05 +08:00
parent 3b88e3aeef
commit 0890d018a7
5 changed files with 6 additions and 7 deletions
docs/docs/install
server/src
web/src/lib/components/shared-components/settings

View file

@ -123,7 +123,6 @@ The default configuration looks like this:
"buttonText": "Login with OAuth",
"clientId": "",
"clientSecret": "",
"defaultStorageQuota": 0,
"enabled": false,
"issuerUrl": "",
"mobileOverrideEnabled": false,

View file

@ -112,7 +112,6 @@ const updatedConfig = Object.freeze<SystemConfig>({
buttonText: 'Login with OAuth',
clientId: '',
clientSecret: '',
defaultStorageQuota: 0,
enabled: false,
issuerUrl: '',
mobileOverrideEnabled: false,

View file

@ -17,10 +17,6 @@ describe('getKeysDeep', () => {
).toEqual(['foo', 'flag', 'count', 'date']);
});
it('should skip undefined properties', () => {
expect(getKeysDeep({ foo: 'bar', hello: undefined })).toEqual(['foo']);
});
it('should skip array indices', () => {
expect(getKeysDeep({ foo: 'bar', hello: ['foo', 'bar'] })).toEqual(['foo', 'hello']);
expect(getKeysDeep({ foo: 'bar', nested: { hello: ['foo', 'bar'] } })).toEqual(['foo', 'nested.hello']);

View file

@ -34,6 +34,7 @@ describe('SettingInputField component', () => {
label: 'test-number-input',
inputType: SettingInputFieldType.NUMBER,
value: 5,
required: true,
},
});
const user = userEvent.setup();

View file

@ -56,7 +56,11 @@
if (newValue > max) {
newValue = max;
}
value = value === '' ? undefined : newValue;
if (!required && value === '') {
value = undefined;
} else {
value = newValue;
}
}
};