Commit graph

30 commits

Author SHA1 Message Date
Suzanne Aitchison
8358571b29
Get a11y lint script paths from rails helper (#13912)
* retrieve paths from rails helper

* move assets to vendor folder, precompile in assets config

* drop coverage on lines

* remove unneeded line
2021-06-10 09:25:29 +01:00
Nick Taylor
86deddbb75
Fixed Reading List on Mobile + Small Improvements (#12755)
* Some div soup to semantic markup.

* Small refactor to inline mapping of available tags.

* Renamed <ItemListTags /> component to <TagList />.

* Now a select is used for picking a tag to filter on.

* Added custom Cypress command to create an article.

* Added documentation for the create article custom command.

* Removed unnecesary properties from payload to create an article.

* reading list mobile view wip.

* Reworked styles in <TagList />.

* Reworked reading list to use <MediaQuery /> component.

* Removed bottom padding from reading list header.

* styling tweaks if there are no available tags.

* Added some E2E tests.

* Removed reading list component test in favour of e2e test.

* Made breakpoint values numbers.

* Added some padding and more grid gap to filter on small screens.

* Adjusted jest coverage thresholds as we're moving some tests to e2e tests.

* Reverting a VS Code setting change caused by one of my extensions.

* First pass for E2E tests for the reading list.

* Added some more grid gap.

* Fixed load next page to send tags properly.

* Added some more tests.

* Improved label and placeholder for text filter in reading list.

* Added more tests

* Fixed media queries so it works in Chrome as well.

* Removed aside as tag filters are not complimentary information.

* Update app/javascript/readingList/components/TagList.jsx

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update docs/tests/e2e-tests.md

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Turned off deprecated rule in jsx-a11y eslint plugin.

* Reverted to links instead of radio buttons.

* Added an all tags link and select option.

* Fixed relayout issue.

* Fixed View Archive button size.

* Fixed styling of the load more button.

* Fixed empty list issue toggling between archive and reading list.

* Fixed request changes from PR review.

* Removed CSS change that is no longer required.

* Trigger Build

* Fixed centering of items in top fieldset.

* Fixed issue with search text field resetting reading list.

* Fixed component tests for the reading list.

* Fixed empty state popping up between search queries.

* Fixed casing of fixture filenames.

* Update app/javascript/readingList/readingList.jsx

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Reverted change in reading list component test.

* Added missing JSDoc comment.

* Now links are in an unordered list.

* Promoted some CSS classes from the <nav /> to the <ul /> for spacing.

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-04-08 12:53:43 +01:00
Suzanne Aitchison
494d92d74c
Create mention autocomplete: initial storybook component (#12831)
* initial setup of component

* initial styles applied

* add some initial docs

* small tweaks to story

* add some very initial tests

* tweaks to styles to add border bottom

* add some preact tests

* import default style in jsx, ignore in jest

* WIP - create MentionAutocompleteListener, attempt to position popover

* position dropdown correctly, exit selection in various scenarios

* refactor

* make sure cursor placed correctly after selection

* only import autocomplete when needed

* rename files, add jsdoc

* update tests and story notes

* tidy up scss file

* fix story styling

* fix aria label in story

* fix issue with key event not triggering in mobile

* position dropdown at input left if small screen

* fix issue with deleting and re-entering

* don't trigger search if directly following a letter or number

* stop change event being fired with highihted text

* move regex out of function into constant
2021-03-05 13:18:26 +00:00
Nick Taylor
2bba2a6ee4
Added the @components webpack alias to the project (#12808)
* Added the @shared webpack alias to the project.

* Added some documentation.

* Fixed a copy paste error.

* Renamed @shared to @components.

* Update docs/frontend/webpacker.md

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-02-24 16:07:48 +01:00
Nick Taylor
e28b75b19a
Fixed eslint/jest configurations for cypress. (#11841) 2020-12-10 12:48:37 +01:00
Nick Taylor
2c79a4c122
Remove non application files from frontend code coverage (#11752)
* Convert index.jsx to index.js as they are just barrel files.

* Removed prop types and eslint configs from code coverage.

* Using <root_dir> in test ignore patterns now.

* Added app/javascript/storybook-static to eslint's ignore list.

* Now .storybook is excluded from code coverage.

* Bumped coverage thresholds

* Fixed to <rootDir>
2020-12-04 20:00:20 -05:00
rhymes
18740bc650
Jest: Lower branches code coverage to 38 to unblock builds (#11441) 2020-11-16 17:06:35 +01:00
Nick Taylor
964a6df518
Bumped jest test coverage thresholds. (#11391) 2020-11-12 11:20:31 -05:00
Rafi
0d2b4c515d
Replace globals with node env (#10767) 2020-10-14 17:05:38 -04:00
Nick Taylor
b733a7c753
Auto-generate CSS utility classes documentation in Storybook (#9633)
Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2020-08-11 23:32:14 -04:00
Lisa Sy
c627086d74
Update Connect responsiveness on smaller viewports (#8829) [deploy]
* Improve responsive experience for Connect

- Create single-screen experience for channels list & chat container on
  small screens
- Remove `expanded` and `contracted` functionality
- Make small UI updates to channels-list
- Update tests accordingly

https://github.com/thepracticaldev/dev.to/issues/8442

* Iterate per first review

- Delete unnecessary conditional for displaying side filters
- Improve width display
- Use different animation for responsive experience
- Add top-border stroke to composer input

* Update app/assets/stylesheets/chat.scss

Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>

* Update app/assets/stylesheets/chat.scss

Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>

* Update app/assets/stylesheets/chat.scss

Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>

* Update app/assets/stylesheets/chat.scss

Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>

* Update app/assets/stylesheets/chat.scss

Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>

* Update app/assets/stylesheets/chat.scss

Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>

* layout fix

* Update test to reflect markup updates

* Fix channels position issue

* Use constants

* Lower coverage threshold

* Update line coverage threshold

https://github.com/thepracticaldev/dev.to/pull/8829#issuecomment-650140589

Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>
Co-authored-by: rhymes <rhymesete@gmail.com>
2020-06-29 09:08:18 -07:00
Nick Taylor
63b4d9fdc0
More frontend test cleanup (#8919) 2020-06-25 18:04:01 -04:00
Nick Taylor
618fc4f902
Since we've added more testing, coverage thresholds can be bumped up a bit. (#8824) 2020-06-22 14:16:22 +02:00
Nick Taylor
653ec12300
Upgrade to Preact 10.4.4 (#8739)
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2020-06-18 10:07:17 -04:00
Nick Taylor
a72831b952
Import jest-axe matchers via setupFilesAfterEnv config property (#8217)
* Now expect is extended for jest-axe via the jest setupFilesAfterEnv config property.

* Renamed a test setup file for jest.
2020-06-01 16:37:32 +02:00
ludwiczakpawel
a161d3ce31
[deploy] Redesign article editor (#7524) 2020-05-29 11:59:37 -04:00
Nick Taylor
4e97623823
Fixed issue with jest picking up the built storybook folder causing tests to run out of memory. (#8096) 2020-05-28 14:22:24 +02:00
Nick Taylor
58135879c8
Configured jest to use the jest-watch-typeahead watch plugin. (#8093)
* Configured jest to use the jest-watch-typeahead watch plugin.

* Added some documentation in regards to jest watch mode.
2020-05-28 10:09:50 +02:00
Nick Taylor
7f8bb406c5
Added coverage threshold to jest configuration. (#7948) 2020-05-19 10:00:48 -04:00
Mac Siri
f75bcf8673
Set Jest's timezone to UTC (#7670) 2020-05-04 14:10:46 -04:00
Nick Taylor
27131f6f42
Request Utility for Frontend (#7317)
* wip

* Added tests.

* Moved request to @utilities/http.

* Now the CSRF token is retrieved properly.
2020-04-22 07:58:15 -04:00
Nick Taylor
8a5109349f
Updated jest code coverage configuration. (#7144) 2020-04-07 17:17:51 -04:00
Nick Taylor
f557c9d474
Created preact component for crayons dropdown (#6961)
* Created barrel files so we can import directly from @crayons.

* Added stories for Dropdown for JSX.

* Tweaked Dropdown Storybook stories.

* Tweaked <Dropdown /> component.

* Added module mapping to jest for @crayons.

* Added tests for <Dropdown /> component.

* Removed Storybook custom decorator that is no longer required.
2020-03-31 09:42:21 -04:00
Nick Taylor
9630a174f9
Added jest config to support test utility modules. (#6154) [deploy] 2020-02-18 12:54:18 -06:00
Nick Taylor
4fe4c4d791
Fixed false negative of a frontend test suite failing. (#6005) 2020-02-10 18:41:45 -06:00
Mario See
faf1c6719b more testing for connect components (#1046)
* adding more tests

- covers article.jsx and elements created from its props and state
- added png as static file that needs stubbing

* video + channelDetails test coverage

* chat + channels tests

* channels cc refactor

* yarn install

* update snapshot and string spacing

* chat.jsx test

mostly tests rendering elements
- does not test imported components, as those are already tested separately
- does not imported functions from actions or utils as those will be tested separately as well

* cleaning up

- mocked response with flush promises for state/component to reflect appropriate changes

* snapshot updates
2018-11-19 15:07:54 -05:00
Mac Siri
4ab0a070ea
Improve Onboarding's spec & Update snapshots (#1111) [ci skip] 2018-11-14 16:18:02 -05:00
Nick Taylor
18980034d3 Nick/feature/search to preact (#532)
* Works, but lots of cleanup/questions.

* Fixed comment.

* Only want the search script to load once with InstantClick active.

* Removed unnecessary DOMContentLoaded from copy paste.

* 🔧 Enabled (P)React Devtools.

* Updated comment about reactToEvent.

* Removed unnecessary server-side generated JS for search.

* <Search /> component now has component state.

* Search functions are in there own module now.

* 👷Refactor

* Render propped it up.

* Fixed issue with encoding of search term.

* Removed data-no-instant attr from script.

* 👷Refactor

* Now flash of search loading is avoided..

* Moved search under components folder.

* Tests

* fixedEncodeURIComponent does not need to be exported.

* Tests

* Folders to ignore from the VS Code Local History extension.

* Tests

* Snapshot test for <Search /> component.

* Tests

* Now the <SearchContainer /> handles the '/' key shortcut.

* Made the search box ID a prop defaulting to 'nav-search'

* Excluded barrel files from code coverage.

* Componentized search CSS.

* Storybook stories for <Search /> component.

* Removed extension folders to ignore.

* Fixed logic for "/" key triggering search.

* updated jest snapshot for <Search /> component.

* updated package.json lock file.

* Disabled the import/prefer-default-export rule.

* Now search term clears if not on a non-search results page.

* removed comment that is no longer valid.

* No longer using render prop for Search. Doesn't make sense as it's not stuff that is reused.

* Added preact-render-spy do dev deps.
2018-07-19 17:02:48 -04:00
Nick Taylor
261b6683b3 Onboarding welcome Storybook stories (#385) 2018-06-05 14:50:30 -04:00
Mac Siri
301c6080e3 Initial commit 2018-02-28 16:11:08 -05:00