Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unit tests for all existing components #684

merged 7 commits into from Nov 30, 2015

Add unit tests for all existing components #684

merged 7 commits into from Nov 30, 2015


Copy link

@fofr fofr commented Nov 27, 2015


  • Beta label
  • Govspeak
  • Pagination
  • Government navigation
  • Document footer
  • Option select
  • Metadata

Also adds some test helpers for making future component unit tests easier, eg

def assert_link_with_text(link, text)
   assert_select "a[href=\"#{link}\"]", text: text

cc @dsingleton @jamiecobbett

fofr added 7 commits Nov 27, 2015
Matches Alpha test
Test that HTML content displays, that right to left works and that rich
govspeak can be enabled.
Test that previous and next navigation display correctly.

Add logic to prevent empty HTML contains from being displayed when no
previous or next local assigns have been provided.
Test that government links are displayed and that they can be marked as
Test a combination of the document metadata that can be passed to this
component. Specifically dates, from links, custom metadata and change
Test that the option select component:
* can start closed
* can include aria control attributes
* can pre-check checkboxes
* creates checkboxes with assigned names, labels and values
Add tests for different metadata types, with links, as text and
containing multiples.

Move some of the test helpers into the component test case so all
component tests have them available.
dsingleton added a commit that referenced this pull request Nov 30, 2015
Add unit tests for all existing components
@dsingleton dsingleton merged commit a47f079 into master Nov 30, 2015
1 check passed
1 check passed
default "Build #698 succeeded on Jenkins"
@dsingleton dsingleton deleted the component-tests branch Nov 30, 2015
Copy link

@dsingleton dsingleton commented Nov 30, 2015

Had a conversation with @fofr offline about the behaviour of components when not passed any arguments. The options were raising an exception, or not rendering anything.

We went with the later for now, to get a standard behaviour defined and revisit later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.