Exclude background layers from legend tests

Self-merge as it fixes currently failing tests.