Add test for isValidDescriptor

Fixes #1164.

Test Plan: grunt test