Skip to content

Commit

Permalink
added helpers and navbar tests for all the styles; updated docker readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ddnexus committed May 8, 2021
1 parent 26b57a8 commit 0fe2e49
Show file tree
Hide file tree
Showing 11 changed files with 10,121 additions and 88 deletions.
22 changes: 11 additions & 11 deletions pagy-on-docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ The pagy docker environment has been designed to be useful for developing:

You have a couple of alternatives:

1. (recommended) Permanently set a few variables about your user in your IDE or system (it will be easier for the future):
1. (recommended) Permanently set a few environment variables about your user in your IDE or system (it will be easier for the future):

- the `GROUP` name (get it with `id -gn` in the terminal)
- the `UID` (get it with `id -u` in the terminal)
- the `GID` (get it with `id -g` in the terminal)
- if `echo $UID` return nothing, then set the `UID` (get it with `id -u` in the terminal)
- if `echo $GID` return nothing, then set the `GID` (get it with `id -g` in the terminal)

(Notice: you can also specify a few other variables used in the `docker-compose.yml` file.)

Expand All @@ -40,12 +40,12 @@ You have a couple of alternatives:

2. Just set them with the command (you will have to set them each time you will have to build or do other stuff) For example:

```sh
cd pagy-on-docker
GROUP=$(id -gn) UID=$(id -u) GID=$(id -g) docker-compose build pagy pagy-jekyll
```
```sh
cd pagy-on-docker
GROUP=$(id -gn) UID=$(id -u) GID=$(id -g) docker-compose build pagy pagy-jekyll
```

You need to run this only once usually, when you build the images. After that you just run the containers (see below).
You need to run this only once usually, when you build the images. After that you just run the containers (see below).

### Run

Expand All @@ -59,12 +59,12 @@ docker-compose up pagy pagy-jekyll # for both pagy and the documentation site
Then:

1. Open a terminal in the pagy container:
- if the container is already up, run bash in the same container `docker-compose exec pagy bash`
- or `docker-compose run --rm pagy bash` to run it in a different container
- if the container is already up, run bash in the same container `docker-compose exec pagy bash`
- or `docker-compose run --rm pagy bash` to run it in a different container

2. `bundle install` to install the gems into the `pagy_bundle` volume.

Then you can run `irb -I lib -r pagy` from the container in order to have `pagy` loaded and ready to try.
At this poin the setup is completed, so you can run `irb -I lib -r pagy` from the container in order to have `pagy` loaded and ready to try.

Run all the tests by simply running `rake` without arguments: it will run the `test`, `rubocop`, `coverge_summary` and `manifest:check` tasks.

Expand Down
6 changes: 3 additions & 3 deletions test/e2e/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ def site_map

end

# routes/actions

get '/pagy.js' do
content_type 'application/javascript'
Expand Down Expand Up @@ -103,6 +102,7 @@ def site_map
</div>



@@ helpers
<h3 id="style"><%= name %></h3>
<hr>
Expand All @@ -116,7 +116,7 @@ def site_map
<hr>

<p>pagy_items_selector_js</p>
<%= pagy_items_selector_js(@pagy, pagy_id: 'item-selector') %>
<%= pagy_items_selector_js(@pagy, pagy_id: 'items-selector-js') %>
<hr>

<p><%= "pagy_#{name_fragment}nav" %></p>
Expand All @@ -128,7 +128,7 @@ def site_map
<hr>

<p><%= "pagy_#{name_fragment}nav_js" %> (responsive)</p>
<%= send(:"pagy_#{name_fragment}nav_js", @pagy, pagy_id: 'nav-js-responsive', steps: { 0 => [1,3,3,1], 540 => [2,4,4,2], 720 => [3,4,4,3] }) %>
<%= send(:"pagy_#{name_fragment}nav_js", @pagy, pagy_id: 'nav-js-responsive', steps: { 0 => [1,3,3,1], 600 => [2,4,4,2], 900 => [3,4,4,3] }) %>
<hr>

<p><%= "pagy_#{name_fragment}combo_nav_js" %></p>
Expand Down
17 changes: 0 additions & 17 deletions test/e2e/cypress/integration/__snapshots__/dummy.spec.js.snap

This file was deleted.

17 changes: 0 additions & 17 deletions test/e2e/cypress/integration/__snapshots__/dummy2.spec.js.snap

This file was deleted.

Loading

0 comments on commit 0fe2e49

Please sign in to comment.