I want to validate that my file names include the SUPPORTED_NAMES. If I upload a file without the account in its name it should not pass validation. right now my code does not pass validation no matter the name of the file
const SUPPORTED_NAMES = ['Account','ticket','task']
validationSchema: Yup.object().shape({
file: Yup.mixed()
.required("file is required")
.test(
"fileName",
"file name not supported",
(value) => value && SUPPORTED_NAMES.includes(value.name)
)