Skip to content

Tests: Update "Behavior" spec to test expected behavior#4348

Merged
thisisdano merged 1 commit into
uswds:developfrom
aduth:aduth-behavior-spec
Feb 15, 2022
Merged

Tests: Update "Behavior" spec to test expected behavior#4348
thisisdano merged 1 commit into
uswds:developfrom
aduth:aduth-behavior-spec

Conversation

@aduth

@aduth aduth commented Oct 5, 2021

Copy link
Copy Markdown
Contributor

Description

This pull request updates behavior.spec.js so as to actually test the expected behavior, using Sinon spies as a synchronous alternative to Mocha done callbacks.

Additional information

The behavior.spec.js file is not currently testing anything meaningful, because it is passing init callbacks with an incorrect function signature (behavior({ init }) vs. behavior(events, { init })). This is also remarked in a comment at the top of the file, accompanied by disabling all ESLint rules for the file to prevent flagging done() calls which reference a done variable that does not exist.


Before you hit Submit, make sure you’ve done whichever of these applies to you:

  • Follow the 18F Front End Coding Style Guide and Accessibility Guide.
  • Run npm test and make sure the tests for the files you have changed have passed.
  • Run your code through HTML_CodeSniffer and make sure it’s error free.
  • Title your pull request using this format: [Website] - [UI component]: Brief statement describing what this pull request solves.

Because currently, it is not testing anything.

@thisisdano thisisdano left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. @mejiaj can you give another set of eyes?

@mejiaj mejiaj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@thisisdano thisisdano merged commit f0cde87 into uswds:develop Feb 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants