phetsims / scenery

Scenery is an HTML5 scene graph.
MIT License
54 stars 12 forks source link

Add more dag related tests for aria-labelledby associations #821

Open zepumph opened 6 years ago

zepumph commented 6 years ago

We are testing dag pretty well one just 1 case (when you are labelledby yourself).

zepumph commented 6 years ago

@jessegreenberg could you help me out with this one? Or maybe could we do it together?

zepumph commented 6 years ago

I thought about one more test that would be nice here, relating to having accessible content or not.


    var m = new Node();
    var n = new Node( {tagName: 'div' });
    m[ addAssociationFunction ]( {
      otherNode: n,
      thisElementName: AccessiblePeer.PRIMARY_SIBLING,
      otherElementName: AccessiblePeer.LABEL_SIBLING
    } );

    m.tagName = 'div';
    /* test */

    var m = new Node();
    var n = new Node();
    m[ addAssociationFunction ]( {
      otherNode: n,
      thisElementName: AccessiblePeer.PRIMARY_SIBLING,
      otherElementName: AccessiblePeer.LABEL_SIBLING
    } );

    m.tagName = 'div';
    n.tagName = 'div';
    /* test */
jessegreenberg commented 6 years ago

Good idea @zepumph. In a dev meeting a while ago, we added more tests to verify behavior after other changes to the scene graph such as adding/removing children, reordering children, and more than one association. I also took a look at the way describedby is being tested in the same way, it looks very nice. Removing my assignment for now, but feel free to reassign if you wish.

zepumph commented 6 years ago