When trying to test my trained model on new test data that has fewer factor levels than my training data,
Type of predictors in new data do not match that of the training data.
R expects both the training and the test data to have the exact same levels (even if one of the sets has no observations for a given level or levels). In your case, since the test dataset is missing a level that the train has, you can do
test$val <- factor(test$val, levels=levels(train$val))
to make sure it has all the same levels and they are coded the same say.
(reposted here to close out the question)