Commit Graph

8268 Commits

Author SHA1 Message Date
Chris Hill-Scott
38c2b32fa8 Add ‘GP’ as an organisation type
Although their allowances are the same as what we call `nhs_local` it
makes more sense to store them separately because:

- we already present them as two separate choices to the user
- we may want to handle them differently in the future, eg in terms of
  what branding choices are available to them

Once the API is updated we can start passing in this new value from
the admin app.
2019-08-28 15:36:09 +01:00
Chris Hill-Scott
efabf0e87d Refactor to avoid redefinition of org types
We’re defining the list of org types in a few different places. This
makes it more likely we’ll forget to update one of these places, thereby
introducing a bug.

This commit moves the definition to be on the organisation model, which
feels like a sensible enough place for it.
2019-08-28 15:36:08 +01:00
karlchillmaid
0466d57565 Merge pull request #3100 from alphagov/fix-heading
Fix heading
2019-08-23 14:40:19 +01:00
karlchillmaid
4c232a9cab Fix h2 tag so heading displays properly 2019-08-23 14:16:23 +01:00
karlchillmaid
0d7005094a Merge pull request #3099 from alphagov/update-receive-text-message-content
Update explanation of inbound SMS
2019-08-23 14:13:54 +01:00
Chris Hill-Scott
922a7fc9dc Fix tests 2019-08-23 13:52:41 +01:00
Tom Byers
86e2b4b117 Merge pull request #3079 from alphagov/add-js-tests-for-sticky-js
Add js tests for sticky js
2019-08-23 13:14:13 +01:00
Tom Byers
78d6419f80 Add tests for window resizing 2019-08-22 15:21:33 +01:00
Tom Byers
fbc68b7bf2 Add tests for viewports < 769px wide
Elements should not stick unless the viewport is
768px wide or larger.
2019-08-22 15:21:33 +01:00
Tom Byers
6871dbcffe Add tests for when caret is underneath sticky
If focus moves to a textarea, we care more about
the caret being overlapped than the textarea.

This adds tests for the caret being overlapped on
load and as a result of it moving underneath the
sticky element from a keyboard event.
2019-08-22 15:21:33 +01:00
Tom Byers
fac116b835 Add tests for handling overlap of activeElement
If an element receives focus when underneath a
stick element, the window should scroll so the
focused element is revealed.

Includes some changes to the WindowMock API to
allow access to data from Jest spies.
2019-08-22 15:21:33 +01:00
Tom Byers
ab6e81a8a6 Add tests for 'shim'
A 'shim' element needs to be added to the page
when an element is made sticky to ensure the
vertical position of everything doesn't change.

When an element becomes sticky it is made
`position: fixed` which removes it from the layout
of the page. The 'shim' is an element added at the
same place in the page with the same dimensions,
so the layout isn't changed.
2019-08-22 15:21:33 +01:00
Tom Byers
381e745ec8 Make helper plug gap in JSDOM's DOM API
Errors fired from JSDOM showed it doesn't support
`window.scrollTo` (or `window.scroll` for that
matter).

This stubs it, to the extent that our use (jQuery
really) of it works.
2019-08-22 15:21:33 +01:00
Tom Byers
8a82d42bf7 Add tests for 'dialog' mode
'dialog' mode was introduced as part of this work:

https://github.com/alphagov/notifications-admin/pull/2682

It lets multiple elements sticky to the viewport
together so a set of UI can be present for a set
scrolling range. It's called a 'dialog' because
the behaviour is closest to that of a modal
dialog.
2019-08-22 15:21:31 +01:00
Tom Byers
85d54637fa Add tests for most scenarios 2019-08-22 15:16:45 +01:00
Tom Byers
823c5a6119 Add clearEvents method & refactor setEvents
`clearEvents` helps write the tests and also gives
users the opportunity to remove all of this
functionality.

Refactor of `setEvents` tidies up use of `self`.
2019-08-22 15:16:45 +01:00
Tom Byers
9ef093cfda Add ScreenMock to helpers
Mocks DOM API calls for position and dimension of
elements and provides an API to allow access to
them.
2019-08-22 15:16:42 +01:00
Tom Byers
13c40a25d1 Changes to WindowMock helper
This includes the following fixes:

1. fix error in `WindowMock.setWidthTo`

   It was returning height, not width.

2. Fix for `WindowMock.reset`

   Changes to the scroll position need to go
   through the `scrollTo` method.

It also includes the following changes

1. Improve mocking of window scrollTop

   Increases the number of DOM API methods mocked
   to return the intended scrollTop value.

2. Change WindowMock.scrollBy to
   WindowMock.scrollTo

   Because you're not scrolling by an amount,
   you're scrolling to a position.

3. Give WindowMock getters for position/dimension

   It's useful to be able to get the
   position/dimension of the window in tests when
   you're resizing and scrolling it as part of the
   test.

4. Assign WindowMock spies on instantiation

   Assigning them whenever a dimension is set doesn't
   make sense. You're just setting a value, not
   changing how that value is accessed.
2019-08-22 15:12:43 +01:00
karlchillmaid
165054866c Add sender name option to 'if' content 2019-08-22 13:55:29 +01:00
karlchillmaid
3f73106b31 Change 'users' to 'they' to reduce repetition 2019-08-22 10:52:26 +01:00
karlchillmaid
2967d7c54e Add code for current sender field 2019-08-22 10:50:04 +01:00
karlchillmaid
2ed988274f Add sender name placeholder 2019-08-22 09:34:47 +01:00
karlchillmaid
1f93b37d5c Update explanation of inbound SMS 2019-08-21 16:55:42 +01:00
karlchillmaid
983a1dc931 Merge pull request #3096 from alphagov/documentation-content-update
Update Documentation content
2019-08-21 14:33:37 +01:00
karlchillmaid
9dd4e46de3 Merge pull request #3098 from alphagov/fix-apostrophes
Fix apostrophes
2019-08-21 11:31:54 +01:00
karlchillmaid
23f2ae1b3a Fix apostrophes 2019-08-21 11:10:23 +01:00
karlchillmaid
d4834c988d Fix apostrophes 2019-08-21 11:08:00 +01:00
karlchillmaid
8989f5a93b Update 'client libraries' 2019-08-21 10:17:36 +01:00
karlchillmaid
c05969e230 Update app/templates/views/documentation.html
Co-Authored-By: Chris Hill-Scott <me@quis.cc>
2019-08-21 10:15:27 +01:00
karlchillmaid
ff663ed172 Update app/templates/views/documentation.html
Co-Authored-By: Chris Hill-Scott <me@quis.cc>
2019-08-21 10:15:17 +01:00
karlchillmaid
6c9f6463c3 Update app/templates/views/documentation.html
Co-Authored-By: Chris Hill-Scott <me@quis.cc>
2019-08-21 10:15:10 +01:00
karlchillmaid
af7222de1d Update app/templates/views/documentation.html
Co-Authored-By: Chris Hill-Scott <me@quis.cc>
2019-08-21 10:15:03 +01:00
Tom Byers
93c3c4705f Merge pull request #3085 from alphagov/add-js-tests-for-api-key
Add js tests for api key
2019-08-21 10:10:21 +01:00
karlchillmaid
744764d625 Merge pull request #3095 from alphagov/features-content-updates-august-2019
Update receive text messages content
2019-08-21 09:58:38 +01:00
karlchillmaid
12f0c1e0ff Update timings and direct integration content 2019-08-21 09:56:27 +01:00
karlchillmaid
3dfa6e06cc Update client documentation content 2019-08-20 17:06:01 +01:00
karlchillmaid
73415f7a08 Update Integrating directly with the API content
Move the line about reading client documentation.
2019-08-20 15:07:48 +01:00
karlchillmaid
39461b369d Add details about timings and direct integration
Outline how long it can take to integrate using the client documentation.

Add more detail about how to integrate directly with the API.
2019-08-20 14:51:54 +01:00
Tom Byers
3c50c3cd01 Merge pull request #3086 from alphagov/add-js-tests-for-colour-preview
Add tests for colour preview
2019-08-20 13:53:32 +01:00
Tom Byers
1edea76a50 Merge pull request #3087 from alphagov/add-js-tests-for-error-tracking
Add tests for error tracking module
2019-08-20 13:53:01 +01:00
Tom Byers
ddd8da0163 Add test for controlling height between states
The button shouldn't change its vertical position
when the state changes. The text confirming the
copy is just one line so setting height for both
based on the API key, which can run to 2 lines
makes sense.

Explained in this PR:

https://github.com/alphagov/notifications-admin/pull/2428
2019-08-20 13:49:09 +01:00
Tom Byers
cc70759a19 Add tests for API key module 2019-08-20 13:49:09 +01:00
Tom Byers
0e7b529fbc Add mock helpers for Range and Selection
To add the text from an element to the clipboard
you need to:
1. get the current Selection
1. create a Range from the contents of the element
2. clear any existing Ranges from the Selection
   and add the new Range to the selection
3. execute the 'copy' command

To track calls to all the DOM APIs involved in
this we need mocks for Range and Selection.

Range:

https://developer.mozilla.org/en-US/docs/Web/API/Range

Selection:

https://developer.mozilla.org/en-US/docs/Web/API/Selection

Also includes a base class to help building out
Web API interface mocks.
2019-08-20 13:49:09 +01:00
karlchillmaid
98f51d8174 Update content 2019-08-20 12:03:42 +01:00
karlchillmaid
016f8f46ec Update receive text messages content
Update receive text messages content for clarity
2019-08-19 15:56:53 +01:00
Pea (Malgorzata Tyczynska)
551c4abee2 Merge pull request #3089 from alphagov/search-services-by-name
Find services by name or partial name
2019-08-16 11:53:07 +01:00
Pea Tyczynska
3844d050ff Simplify find users by email view - valdiation already done by form 2019-08-16 11:20:36 +01:00
Pea Tyczynska
c717e37c48 Test no input 2019-08-15 17:06:43 +01:00
karlchillmaid
2eed904476 Merge pull request #3091 from alphagov/roadmap-update
Update roadmap
2019-08-15 15:58:42 +01:00
karlchillmaid
2707e5192e Amend content for clarity 2019-08-15 15:13:39 +01:00