#307 Add ipp.upload.notice for a customisable notice on the upload page

This commit is contained in:
Alan Grainger
2026-10-19 14:25:55 +13:00
parent c739e931ea
commit 8bf1d753aa
9 changed files with 47 additions and 18 deletions
+9 -1
View File
@@ -1,5 +1,5 @@
import { describe, it, expect, afterEach } from 'vitest'
import { byteBudget, filenamePrefix, maxFileSize, notifyConfig } from '../src/config'
import { byteBudget, filenamePrefix, maxFileSize, notifyConfig, uploadNotice } from '../src/config'
import { resetConfig, setConfig } from './helpers'
afterEach(resetConfig)
@@ -12,6 +12,14 @@ describe('upload options', () => {
expect(byteBudget()).toBe(10240 * MB)
expect(filenamePrefix()).toBe('ipp_upload_')
expect(notifyConfig()).toBeUndefined()
expect(uploadNotice()).toBe('Uploaded photos may not appear in the gallery immediately.')
})
it('shows the owner\'s notice, and hides one that is not a string', () => {
setConfig({ ipp: { upload: { notice: 'Les photos apparaissent plus tard.' } } })
expect(uploadNotice()).toBe('Les photos apparaissent plus tard.')
setConfig({ ipp: { upload: { notice: false } } })
expect(uploadNotice()).toBe('')
})
it('never lets maxFileSize reach zero, which would refuse every file', () => {