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

JavaScript Tests, Take 1. #2176

Merged
merged 67 commits into from
May 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
e5a526a
Restructure files with some tests added
swissspidy Apr 23, 2019
be467c4
Tinker with e2e test setup
swissspidy Apr 25, 2019
20d1790
Merge branch 'amp-stories-redux' into amp-story/test-restructuring
swissspidy Apr 25, 2019
d97fb07
Rename files
swissspidy Apr 25, 2019
fcd833d
Fix path
swissspidy Apr 25, 2019
d30c6b5
s/gutenberg/amp
swissspidy Apr 25, 2019
c5e9c48
Package updates
swissspidy Apr 25, 2019
f234b60
Add docker-compose file for e2e tests
swissspidy Apr 25, 2019
07f3c61
Update jest config
swissspidy Apr 25, 2019
fd57749
Merge branch 'amp-stories-redux' into amp-story/test-restructuring
swissspidy Apr 25, 2019
40900fd
Fix file name in build check
swissspidy Apr 25, 2019
3bea9b1
Fix webpack context regex
swissspidy Apr 25, 2019
59797b1
More fixes
swissspidy Apr 25, 2019
29fbb1f
Update ESLint config
swissspidy Apr 25, 2019
37c9e7f
Remove unneeded assignment
swissspidy Apr 25, 2019
a55eaea
Lint package.json
swissspidy Apr 25, 2019
54756fb
Merge branch 'amp-stories-redux' into amp-story/test-restructuring
swissspidy Apr 26, 2019
44740e6
Merge branch 'amp-stories-redux' into amp-story/test-restructuring
swissspidy Apr 29, 2019
aa7abf2
Merge branch 'amp-stories-redux' into amp-story/test-restructuring
swissspidy Apr 29, 2019
ac52460
Reorganize components some more
swissspidy Apr 30, 2019
4665913
Add tests for getRgbaFromHex
swissspidy Apr 30, 2019
a9f284e
Update packages
swissspidy Apr 30, 2019
82f2a1d
Add some tests and docs
swissspidy Apr 30, 2019
8dbe6f8
Shuffle files around
swissspidy Apr 30, 2019
59b5baf
Composer update
swissspidy Apr 30, 2019
a8e1458
Move helpers to directory
swissspidy Apr 30, 2019
6da3a26
Add some docs
swissspidy Apr 30, 2019
4be9711
Fix store import
swissspidy Apr 30, 2019
a8ef22f
Mock wp media globals
swissspidy Apr 30, 2019
164df73
Extend amp-stories-fonts mock
swissspidy Apr 30, 2019
8dd6602
Make usage of window.wp explicit
swissspidy Apr 30, 2019
c8bd83e
Remove errant number sign
swissspidy Apr 30, 2019
9fe0ff6
Correctly pass originalState
swissspidy Apr 30, 2019
80f1624
Add tests for maybeEnqueueFontStyle
swissspidy Apr 30, 2019
b4399a8
Update some tests and snapshots
swissspidy Apr 30, 2019
34eb273
Add tests for getTagName
swissspidy Apr 30, 2019
ae0155e
Move HOCs to sub folder
swissspidy Apr 30, 2019
4918fbd
Improve docs
swissspidy Apr 30, 2019
1f66fd7
Fix imports
swissspidy Apr 30, 2019
1acda7f
Ignore e2e tests in unit tests
swissspidy Apr 30, 2019
4ba718d
Add test for getBackgroundColorWithOpacity
swissspidy Apr 30, 2019
d0468bf
Update script name in phpunit test
swissspidy Apr 30, 2019
d51a3bb
Fix & test getMinimumStoryPosterDimensions
swissspidy Apr 30, 2019
05daab8
Fix hasMinimumDimensions docs
swissspidy Apr 30, 2019
f1baf8c
Fix expected file name
swissspidy Apr 30, 2019
a756aef
Revert readme change
swissspidy May 1, 2019
fbba14e
Extract variable
swissspidy May 1, 2019
6b5a9fa
Begin some new tests
swissspidy May 1, 2019
5c46927
Work on meta block tests
swissspidy May 1, 2019
b956684
Optimize/Minimize CSS
swissspidy May 2, 2019
a564f9b
Fix typo
swissspidy May 2, 2019
e878cd7
Use package imports in amp-editor-blocks.js
swissspidy May 2, 2019
1261fda
Use package imports in amp-block-validation.js
swissspidy May 2, 2019
5e6f960
Align docblock
swissspidy May 2, 2019
0c5fb2d
Use package imports in amp-validation-detail-toggle.js
swissspidy May 2, 2019
36bef22
Use package imports in amp-validation-single-error-url-details.js
swissspidy May 2, 2019
63404b3
Merge branch 'amp-stories-redux' into amp-story/test-restructuring
swissspidy May 2, 2019
857c3a5
Update browserslist
swissspidy May 2, 2019
93936fa
Remove less-relevant tests for super simple withSelect HOCs
swissspidy May 2, 2019
bcacd68
Remove outdated/unused snapshot
swissspidy May 2, 2019
6863c1d
Merge branch 'amp-stories-redux' into amp-story/test-restructuring
swissspidy May 2, 2019
0890de1
Merge branch 'amp-stories-redux' into amp-story/test-restructuring
swissspidy May 2, 2019
46b835a
Merge branch 'amp-stories-redux' into amp-story/test-restructuring
swissspidy May 2, 2019
82a7cf1
Merge branch 'amp-stories-redux' into amp-story/test-restructuring
swissspidy May 3, 2019
4c9823d
Merge branch 'amp-stories-redux' into amp-story/test-restructuring
swissspidy May 3, 2019
6ce9390
Merge branch 'amp-stories-redux' into amp-story/test-restructuring
swissspidy May 5, 2019
f83dc4d
Fix path
swissspidy May 5, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions .babelrc

This file was deleted.

3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
**/*.min.js
**/node_modules/**
**/vendor/**
**/assets/js/*-compiled.js
**/assets/js/*.js
!assets/js/amp-service-worker-runtime-precaching.js
build/*
4 changes: 3 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
{
"root": true,
"extends": [ "plugin:@wordpress/eslint-plugin/recommended" ],
"extends": [ "plugin:@wordpress/eslint-plugin/recommended", "plugin:jest/recommended" ],
"settings": {
"react": {
"pragma": "wp",
"version": "16.6"
}
},
"globals": {
"browser": true,
"page": true,
"wp": true,
"Set": true
}
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ amp.zip
assets/css/*-compiled.css
assets/css/*-compiled-rtl.css
assets/css/*.map
assets/js/*-compiled.js
assets/js/*.js
!assets/js/amp-service-worker-runtime-precaching.js
assets/js/*.map
built
/amphtml
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/*
2 changes: 1 addition & 1 deletion amp.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
}
unset( $_amp_required_extensions, $_amp_missing_extensions, $_amp_required_extension, $_amp_missing_extension );

if ( ! file_exists( __DIR__ . '/vendor/autoload.php' ) || ! file_exists( __DIR__ . '/vendor/sabberworm/php-css-parser' ) || ! file_exists( __DIR__ . '/assets/js/amp-block-editor-compiled.js' ) ) {
if ( ! file_exists( __DIR__ . '/vendor/autoload.php' ) || ! file_exists( __DIR__ . '/vendor/sabberworm/php-css-parser' ) || ! file_exists( __DIR__ . '/assets/js/amp-block-editor.js' ) ) {
$_amp_load_errors->add(
'build_required',
sprintf(
Expand Down
File renamed without changes.
132 changes: 0 additions & 132 deletions assets/src/amp-block-editor.js

This file was deleted.

11 changes: 0 additions & 11 deletions assets/src/amp-blocks.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
/**
* Localized data
*/
/**
* External dependencies
*/
import { detailToggleBtnAriaLabel, sourcesToggleBtnAriaLabel } from 'amp-validation-i18n';

/**
* WordPress dependencies
*/
import domReady from '@wordpress/dom-ready';

const OPEN_CLASS = 'is-open';

/**
Expand Down Expand Up @@ -77,7 +79,7 @@ function addTermListTableRowClasses() {
} );
}

wp.domReady( () => {
domReady( () => {
addToggleButtons( 'th.column-details.manage-column', detailToggleBtnAriaLabel )
.forEach( ( btn ) => {
addToggleAllListener( {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* WordPress dependencies
*/
import domReady from '@wordpress/dom-ready';

/**
* Toggles the contents of a details element as an additional table tr.
*/
Expand Down Expand Up @@ -149,6 +154,6 @@ class ErrorRows {
}
}

wp.domReady( () => {
domReady( () => {
new ErrorRows().init();
} );
Loading