Add tests, fix errors

make-only-subtitle-default
greg.pringle 3 years ago
parent 1b16da3009
commit 7c56b3a517

@ -12,9 +12,9 @@ const details = () => ({
{
name: 'minModifiedDaysOld',
type: 'number',
defaultValue: '30',
defaultValue: 30,
inputUI: {
type: 'number',
type: 'text',
},
tooltip: `Enter minimum number of days since modified since now file must be.
@ -43,7 +43,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => {
// response.infoLog += ` Age ${age} Require Min Age: ${reqage}`;
if (reqage < age)
{
// response.infoLog += " Old enough, lets do this!";
response.infoLog += "File modified date old enough. Moving to next plugin.";
response.processFile = true;
}
else

@ -0,0 +1,63 @@
/* eslint max-len: 0 */
const run = require('../helpers/run');
const tests = [
{
input: {
file: require('../sampleData/media/sampleH264_2.json'),
librarySettings: {},
inputs: {
minModifiedDaysOld: 1
},
otherArguments: {},
},
output: {
processFile: true,
infoLog: 'File modified date old enough. Moving to next plugin.',
},
},
{
input: {
file: require('../sampleData/media/sampleH264_1.json'),
librarySettings: {},
inputs: {
minModifiedDaysOld: 9999
},
otherArguments: {},
},
output: {
processFile: false,
infoLog: 'Skipping, file modified date not old enough',
},
},
{
input: {
file: require('../sampleData/media/sampleH264_1.json'),
librarySettings: {},
inputs: {
minModifiedDaysOld: 1
},
otherArguments: {},
},
output: {
processFile: true,
infoLog: 'File modified date old enough. Moving to next plugin.',
},
},
{
input: {
file: require('../sampleData/media/sampleH264_1.json'),
librarySettings: {},
inputs: {
minModifiedDaysOld: 9999
},
otherArguments: {},
},
output: {
processFile: false,
infoLog: 'Skipping, file modified date not old enough',
},
},
];
run(tests);
Loading…
Cancel
Save