Document time date placeholder transforms
This commit is contained in:
@@ -64,6 +64,31 @@ test('time/date region renders placeholder tokens on the player side', () => {
|
||||
assert.match(markup, /<p>\d{2}:\d{2}<\/p>/);
|
||||
});
|
||||
|
||||
test('time/date lowercase day period renders in lowercase', () => {
|
||||
const module = loadTimeDateModule();
|
||||
const markup = module.renderRegion(
|
||||
{
|
||||
pixelWidth: 320,
|
||||
pixelHeight: 180,
|
||||
canvasScale: 1,
|
||||
baseStyle: 'position:absolute;'
|
||||
},
|
||||
{
|
||||
value: '{{a}}',
|
||||
timezone: 'UTC'
|
||||
}
|
||||
);
|
||||
|
||||
assert.match(markup, /<p>(am|pm)<\/p>/);
|
||||
});
|
||||
|
||||
test('time/date editor popup documents text and math transforms', () => {
|
||||
const editorSource = fs.readFileSync(require.resolve('../src/web/public/js/regions/type/time-date.js'), 'utf8');
|
||||
|
||||
assert.match(editorSource, /renderTextTransforms\(\)/);
|
||||
assert.match(editorSource, /renderMathTransforms\(\)/);
|
||||
});
|
||||
|
||||
test('time/date region stays blank when its format is blank', () => {
|
||||
const module = loadTimeDateModule();
|
||||
const markup = module.renderRegion(
|
||||
|
||||
Reference in New Issue
Block a user