#302 add name field for uploads

This commit is contained in:
Alan Grainger
2026-10-19 15:43:29 +13:00
parent b1e053426f
commit a620d0b3ae
19 changed files with 257 additions and 24 deletions
+9 -1
View File
@@ -1,5 +1,5 @@
import { describe, it, expect, afterEach } from 'vitest'
import { byteBudget, filenamePrefix, maxFileSize, notifyConfig, uploadNotice } from '../src/config'
import { askName, byteBudget, filenamePrefix, maxFileSize, notifyConfig, uploadNotice } from '../src/config'
import { resetConfig, setConfig } from './helpers'
afterEach(resetConfig)
@@ -13,6 +13,14 @@ describe('upload options', () => {
expect(filenamePrefix()).toBe('ipp_upload_')
expect(notifyConfig()).toBeUndefined()
expect(uploadNotice()).toBe('Uploaded photos may not appear in the gallery immediately.')
expect(askName()).toBe(true)
})
it('turns the name field off only on an explicit false', () => {
setConfig({ ipp: { upload: { askName: false } } })
expect(askName()).toBe(false)
setConfig({ ipp: { upload: { askName: 0 } } })
expect(askName()).toBe(true)
})
it('shows the owner\'s notice, and hides one that is not a string', () => {