You can use Element.classList.contains
function to check if specified class value exists in class attribute of the element.
So assertion should look like:
if (boxes.classList.contains('winning')) {
UPD
As Karl Wilbur noticed in the comments to my answer, boxes
is a NodeList instance.
So, you have to convert it into array:
var boxes = Array.prototype.slice.apply(document.getElementsByTagName('li'));
and you will be able to iterate over it:
boxes.some(function(el) {
return el.classList.contains('winning');
});
this should return true if at least one of the boxes contains a class name 'winning'.