Skip to content

Commit

Permalink
Add e2e tests (#1)
Browse files Browse the repository at this point in the history
* Initial effort

* Simplify setup

* First test

* Another test

* Finalise responsive test

* Further tests for auto device type switching

* Document how to run tests
  • Loading branch information
getdave authored Sep 23, 2024
1 parent b1ee820 commit 7ff1376
Show file tree
Hide file tree
Showing 10 changed files with 1,027 additions and 24 deletions.
1 change: 1 addition & 0 deletions .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
.gitignore
.prettierignore
.prettierrc.js
.wp-env.override.json
package-lock.json
package.json
phpcs.xml
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
build/
vendor/
.DS_Store
.DS_Store
/artifacts
6 changes: 6 additions & 0 deletions .wp-env.override.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"core": null,
"plugins": [ "." ],
"port": 4012,
"testsPort": 4013
}
4 changes: 2 additions & 2 deletions getdave-responsive-navigation-block.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Plugin Name: Responsive Navigation Block - control your menus based on screen size.
* Plugin Name: Responsive Navigation Block
* Description: Allows you to show different navigation menus based on the screen size using the Navigation block.
* Requires at least: 6.5
* Version: 1.0.2
Expand Down Expand Up @@ -108,7 +108,7 @@ function generate_block_breakpoints_css( $breakpoint, $unit ) {
$breakpoint = absint( $breakpoint );
$unit = sanitize_text_field( $unit );

return '
return '
@media (min-width: ' . esc_attr( $breakpoint ) . esc_attr( $unit ) . ') {
.wp-block-navigation.' . esc_attr( GDRNB_MOBILE_NAV_CLASS ) . ' {
display: none;
Expand Down
Loading

0 comments on commit 7ff1376

Please sign in to comment.