Commit Graph

74 Commits (bda43293f6a63cf7c0b3c3dc99783280a36c14ee)

Author SHA1 Message Date
Hunter Trujillo bc7f75d25a Prettier tests. 2017-06-07 10:23:53 -06:00
Jade McGough 84745e96f3 webpack is configured to resolve pathnames that start with shared, the src is unnecessary 2017-05-30 14:36:59 -07:00
Alex P 6e77bba6bd Rename template control bar variable names for consistency 2017-05-23 11:43:42 -07:00
Alex P c50b300395 Write test for tempvar controls toggle 2017-05-23 11:26:46 -07:00
Jared Scheib 6b62cb1b87 Add test for ME_RECEIVED 2017-04-17 12:24:43 -07:00
Jared Scheib f62c4b1ba2 Add test for AUTH_RECEIVED 2017-04-17 12:22:30 -07:00
Jared Scheib 91fa4c4111 Add test for AUTH_REQUESTED 2017-04-17 12:19:51 -07:00
Jared Scheib dff050e7ff Add auth test for AUTH_EXPIRED 2017-04-17 12:17:45 -07:00
Jared Scheib a02e64d3d2 Add test for errors reducer; update errors reducer to clearer data shape 2017-04-17 11:54:11 -07:00
Andrew Watkins c6989c3694 Refactor tests 2017-03-31 12:22:03 -07:00
Andrew Watkins 8c51f7f864 Add tests 2017-03-31 10:57:00 -07:00
Andrew Watkins 94f6cd171d Fix tests for new approach 2017-03-30 18:40:37 -07:00
Andrew Watkins 179478e97a Lint fix all tests 2017-03-30 15:57:33 -07:00
Timothy J. Raymond 67c2b98f68 Redirect to default source when deleting sources (#1074)
* Redirect to default source on invalid source ID

When supplied with an invalid source ID, the CheckSources component
would redirect the user to a "Create Source" page. This caused
surprising behavior when a source was deleted because that source ID
would become invalid. The effect being that deleting a source brought
users immediately to the create source page, rather than back to the
sources list.

This instead redirects users to the default source when provided an
invalid source id. The backend automatically re-assigns the "default"
source, so this will always succeed, since sources are fetched again
from the backend.

The regex used is slightly dependent on URL structure that has been
stable over the lifetime of this project. Also it relies on URL
structure more than the previous redirecting implementation.

* Force sources to reload after deletion

Deleting a source invalidates the state held by the client because of
automatic re-assignment of the default source by the backend. Without
duplicating backend logic, it is impossible for the frontend to discover
the new source without reloading sources.

The ManageSources page now uses an async-action creator which deletes
the requested source and reloads all sources. The source action creators
have also been refactored to use implicit returns like other action
creators.

* Remove Dead removeSource action

removeSource is no longer used because the API invalidates its
assumptions. For more information, see 04bf3ca.

* Update Changelog with source deletion redirect fix

Users are no longer unexpectedly redirected to the "create source" page
whenever they delete a source that they are connected to.

* Return 404 when deleting non-existent source

When deleting a source, a new default is assigned automatically. If a
non-existent source ID was provided, previously this would result in a
500. This is a violation of the Swagger docs. The solution is to examine
the error and if it was an ErrSourceNotFound, invoke the notFound
handler.

* Add Error handling to source deletion

There are two kinds of errors that can be encountered when deleting a
source: a 404 and a 500 (from either the delete or the subsequent
fetch).

The 404 is a precondition failure of the action creator. The source.id
requested can be non-existent for two reasons: 1) The action creator was
passed garbage by the caller. 2) A concurrent write occurred which
silently invalidated this session's state. For the first case, we can
ensure that the caller is sane by having an assertion check that the
requested source is among some set of sources. This could be
circumvented by a caller, but chances are good that both the full set of
sources and the desired source are both available to callers of this
action creator. The second case is not an error. In this case, we should
proceed reloading sources, since the deletion that was requested has
already been performed by someone else.

Finally, 500s can only occur if there is something broken with the API.
In this situation, we provide a notification that tells the user to
check the API logs for more information.

* Remove duplicate CHANGELOG entries

These were introduced due to a naive merge conflict resolution.

* Remove assertion

This was decided to be confusing and unnecessary.

* Remove remnants of removed assertion

These were needed for an assertion that has been removed. It's no longer
necessary to pass `sources` to the action creator.
2017-03-28 08:53:11 -07:00
Jared Scheib 9887f47181 Refactor to test combined appReducer, add tests for ephemeral app state reducer 2017-03-03 17:06:47 -08:00
Jared Scheib 668f4cfdd3 Add test for autoRefresh reducer 2017-03-03 16:57:05 -08:00
Jared Scheib 5a81d8da2a Refactor tests for clarity and simplicity 2017-02-16 14:51:22 -08:00
Jared Scheib dd295ce15b Test for unpadded range when passing in values well within extremities 2017-02-15 18:29:30 -08:00
Jared Scheib 2e8b8378ce Test for padded range when passing in values at range extremities 2017-02-15 18:28:44 -08:00
Hunter Trujillo a0b1ef5521 Refactor parseAlerta spec to test reducer, accessors, and parser separately. Refactor parseAlerta out of rules reducer into its own file in shared/prasing. Update appearance of AlertaConfig. Update appearance of RuleMessage input field. Remove smtp and alerta from default alerts. 2017-02-10 13:03:31 -07:00
Hunter Trujillo 0e39dcecef Add reducer spec for shared/sources. Add nodemon script to package.json to help with TDD. Fix actual issue: duplicate defaults in sources. 2017-01-26 16:55:05 -07:00
Andrew Watkins 2f66af3e5a Add tests for range calc 2017-01-12 14:19:48 -08:00
Will Piers c608f3f665 Remove old spec 2016-11-21 16:10:00 -07:00
Will Piers 4d20b2af4a Bring over enterprise ui and configuration
Signed-off-by: Andrew Watkins <watts@influxdb.com>
2016-09-19 13:45:05 -07:00