decidim-dev 0.26.2 → 0.27.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/app/commands/decidim/dummy_resources/create_dummy_resource.rb +1 -1
  3. data/app/controllers/concerns/decidim/dev/needs_development_tools.rb +1 -1
  4. data/config/locales/ar.yml +1 -0
  5. data/config/locales/bg.yml +1 -0
  6. data/config/locales/ca.yml +7 -0
  7. data/config/locales/cs.yml +5 -0
  8. data/config/locales/de.yml +1 -0
  9. data/config/locales/el.yml +1 -0
  10. data/config/locales/en.yml +6 -0
  11. data/config/locales/es-MX.yml +7 -0
  12. data/config/locales/es-PY.yml +7 -0
  13. data/config/locales/es.yml +7 -0
  14. data/config/locales/eu.yml +1 -0
  15. data/config/locales/fi-plain.yml +7 -0
  16. data/config/locales/fi.yml +7 -0
  17. data/config/locales/fr-CA.yml +7 -0
  18. data/config/locales/fr.yml +7 -0
  19. data/config/locales/ga-IE.yml +1 -0
  20. data/config/locales/gl.yml +1 -0
  21. data/config/locales/hu.yml +1 -0
  22. data/config/locales/id-ID.yml +1 -0
  23. data/config/locales/is-IS.yml +2 -1
  24. data/config/locales/it.yml +1 -0
  25. data/config/locales/ja.yml +7 -0
  26. data/config/locales/lt.yml +64 -0
  27. data/config/locales/lv.yml +1 -0
  28. data/config/locales/nl.yml +1 -0
  29. data/config/locales/no.yml +1 -0
  30. data/config/locales/pl.yml +1 -0
  31. data/config/locales/pt-BR.yml +1 -0
  32. data/config/locales/pt.yml +1 -0
  33. data/config/locales/ro-RO.yml +1 -0
  34. data/config/locales/ru.yml +1 -0
  35. data/config/locales/sk.yml +1 -0
  36. data/config/locales/sl.yml +1 -0
  37. data/config/locales/sr-CS.yml +1 -0
  38. data/config/locales/sv.yml +1 -0
  39. data/config/locales/tr-TR.yml +1 -0
  40. data/config/locales/uk.yml +1 -0
  41. data/config/locales/zh-CN.yml +1 -0
  42. data/lib/decidim/dev/assets/geocoder_result_here.json +46 -67
  43. data/lib/decidim/dev/assets/import_voting_census_only_headers.csv +1 -0
  44. data/lib/decidim/dev/assets/logo.png +0 -0
  45. data/lib/decidim/dev/assets/ssl-cert.pem +22 -0
  46. data/lib/decidim/dev/assets/ssl-key.pem +28 -0
  47. data/lib/decidim/dev/common_rake.rb +1 -0
  48. data/lib/decidim/dev/railtie.rb +1 -1
  49. data/lib/decidim/dev/test/base_spec_helper.rb +2 -1
  50. data/lib/decidim/dev/test/rspec_support/attachment_helpers.rb +30 -0
  51. data/lib/decidim/dev/test/rspec_support/autocomplete_select.rb +23 -0
  52. data/lib/decidim/dev/test/rspec_support/capybara.rb +77 -9
  53. data/lib/decidim/dev/test/rspec_support/comments.rb +1 -1
  54. data/lib/decidim/dev/test/rspec_support/component.rb +5 -5
  55. data/lib/decidim/dev/test/rspec_support/controller_example_group.rb +27 -0
  56. data/lib/decidim/dev/test/rspec_support/data_consent.rb +41 -0
  57. data/lib/decidim/dev/test/rspec_support/dynamic_attach.rb +31 -0
  58. data/lib/decidim/dev/test/rspec_support/frontend.rb +1 -1
  59. data/lib/decidim/dev/test/rspec_support/geocoder.rb +6 -2
  60. data/lib/decidim/dev/test/rspec_support/helpers.rb +12 -0
  61. data/lib/decidim/dev/test/rspec_support/html_matchers.rb +11 -0
  62. data/lib/decidim/dev/test/rspec_support/imports_controller_shared_examples.rb +3 -8
  63. data/lib/decidim/dev/test/rspec_support/network_conditions_helpers.rb +18 -0
  64. data/lib/decidim/dev/test/rspec_support/rake_tasks.rb +0 -2
  65. data/lib/decidim/dev/test/rspec_support/screenshot_helper.rb +41 -0
  66. data/lib/decidim/dev/test/rspec_support/warden.rb +5 -0
  67. data/lib/decidim/dev/test/rspec_support/wicked_pdf_assets_mock.rb +4 -0
  68. data/lib/decidim/dev/test/spec_helper.rb +2 -4
  69. data/lib/decidim/dev/test/w3c_rspec_validators_overrides.rb +0 -2
  70. data/lib/decidim/dev/version.rb +1 -1
  71. data/lib/decidim-dev.rb +1 -1
  72. data/lib/tasks/generators.rake +7 -2
  73. data/lib/tasks/lighthouse_report.rake +29 -0
  74. data/lib/tasks/locale_checker.rake +1 -1
  75. metadata +51 -41
  76. data/lib/decidim/dev/test/rspec_support/react_select.rb +0 -29
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ namespace :decidim do
4
+ namespace :lighthouse do
5
+ desc "Prepares seeds for Lighthouse report"
6
+ task prepare_urls: :environment do
7
+ # Lighhouse report is executed in CI and should check:
8
+ # - homepage
9
+ # - a participatory process page
10
+ # - a meeting page
11
+ # - a proposal page
12
+ #
13
+ # Because seeds make urls dynamic, this task updates the lighthouse configuration
14
+ # to add dynamically the urls to check.
15
+
16
+ host = "http://localhost:3000"
17
+ urls = ["/"]
18
+ urls << ::Decidim::ResourceLocatorPresenter.new(Decidim::ParticipatoryProcess.published.first).path
19
+ urls << ::Decidim::ResourceLocatorPresenter.new(Decidim::Meetings::Meeting.published.first).path
20
+ urls << ::Decidim::ResourceLocatorPresenter.new(Decidim::Proposals::Proposal.published.first).path
21
+
22
+ # Update lighthouse configuration with the urls
23
+ lighthouse_rc_path = Rails.root.join("../.lighthouserc.json")
24
+ lighthouserc = JSON.parse(File.read(lighthouse_rc_path))
25
+ lighthouserc["ci"]["collect"]["url"] = urls.map { |url| "#{host}#{url}" }
26
+ File.write(lighthouse_rc_path, lighthouserc.to_json)
27
+ end
28
+ end
29
+ end
@@ -5,7 +5,7 @@ namespace :decidim do
5
5
  task check_locales: :environment do
6
6
  FileUtils.remove_dir("tmp/decidim_repo", true)
7
7
 
8
- branch = ENV["TARGET_BRANCH"] || "develop"
8
+ branch = ENV.fetch("TARGET_BRANCH", nil) || "develop"
9
9
  status = system("git clone --depth=1 --single-branch --branch #{branch} https://github.com/decidim/decidim tmp/decidim_repo")
10
10
  return unless status
11
11
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-dev
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.26.2
4
+ version: 0.27.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josep Jaume Rey Peroy
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2022-06-14 00:00:00.000000000 Z
13
+ date: 2022-09-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: capybara
@@ -32,14 +32,14 @@ dependencies:
32
32
  requirements:
33
33
  - - '='
34
34
  - !ruby/object:Gem::Version
35
- version: 0.26.2
35
+ version: 0.27.0.rc2
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - '='
41
41
  - !ruby/object:Gem::Version
42
- version: 0.26.2
42
+ version: 0.27.0.rc2
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: factory_bot_rails
45
45
  requirement: !ruby/object:Gem::Requirement
@@ -144,14 +144,28 @@ dependencies:
144
144
  requirements:
145
145
  - - "~>"
146
146
  - !ruby/object:Gem::Version
147
- version: '1.12'
147
+ version: '1.13'
148
148
  type: :runtime
149
149
  prerelease: false
150
150
  version_requirements: !ruby/object:Gem::Requirement
151
151
  requirements:
152
152
  - - "~>"
153
153
  - !ruby/object:Gem::Version
154
- version: '1.12'
154
+ version: '1.13'
155
+ - !ruby/object:Gem::Dependency
156
+ name: parallel_tests
157
+ requirement: !ruby/object:Gem::Requirement
158
+ requirements:
159
+ - - "~>"
160
+ - !ruby/object:Gem::Version
161
+ version: '3.7'
162
+ type: :runtime
163
+ prerelease: false
164
+ version_requirements: !ruby/object:Gem::Requirement
165
+ requirements:
166
+ - - "~>"
167
+ - !ruby/object:Gem::Version
168
+ version: '3.7'
155
169
  - !ruby/object:Gem::Dependency
156
170
  name: puma
157
171
  requirement: !ruby/object:Gem::Requirement
@@ -186,14 +200,14 @@ dependencies:
186
200
  requirements:
187
201
  - - "~>"
188
202
  - !ruby/object:Gem::Version
189
- version: 0.3.4
203
+ version: 0.3.7
190
204
  type: :runtime
191
205
  prerelease: false
192
206
  version_requirements: !ruby/object:Gem::Requirement
193
207
  requirements:
194
208
  - - "~>"
195
209
  - !ruby/object:Gem::Version
196
- version: 0.3.4
210
+ version: 0.3.7
197
211
  - !ruby/object:Gem::Dependency
198
212
  name: rspec-html-matchers
199
213
  requirement: !ruby/object:Gem::Requirement
@@ -256,98 +270,84 @@ dependencies:
256
270
  requirements:
257
271
  - - "~>"
258
272
  - !ruby/object:Gem::Version
259
- version: 0.92.0
273
+ version: 1.28.0
260
274
  type: :runtime
261
275
  prerelease: false
262
276
  version_requirements: !ruby/object:Gem::Requirement
263
277
  requirements:
264
278
  - - "~>"
265
279
  - !ruby/object:Gem::Version
266
- version: 0.92.0
280
+ version: 1.28.0
267
281
  - !ruby/object:Gem::Dependency
268
282
  name: rubocop-rails
269
283
  requirement: !ruby/object:Gem::Requirement
270
284
  requirements:
271
285
  - - "~>"
272
286
  - !ruby/object:Gem::Version
273
- version: '2.8'
287
+ version: '2.14'
274
288
  type: :runtime
275
289
  prerelease: false
276
290
  version_requirements: !ruby/object:Gem::Requirement
277
291
  requirements:
278
292
  - - "~>"
279
293
  - !ruby/object:Gem::Version
280
- version: '2.8'
294
+ version: '2.14'
281
295
  - !ruby/object:Gem::Dependency
282
296
  name: rubocop-rspec
283
297
  requirement: !ruby/object:Gem::Requirement
284
298
  requirements:
285
- - - '='
299
+ - - "~>"
286
300
  - !ruby/object:Gem::Version
287
- version: 1.43.2
301
+ version: '2.10'
288
302
  type: :runtime
289
303
  prerelease: false
290
304
  version_requirements: !ruby/object:Gem::Requirement
291
305
  requirements:
292
- - - '='
306
+ - - "~>"
293
307
  - !ruby/object:Gem::Version
294
- version: 1.43.2
308
+ version: '2.10'
295
309
  - !ruby/object:Gem::Dependency
296
310
  name: selenium-webdriver
297
311
  requirement: !ruby/object:Gem::Requirement
298
312
  requirements:
299
313
  - - "~>"
300
314
  - !ruby/object:Gem::Version
301
- version: '3.142'
315
+ version: 4.1.0
302
316
  type: :runtime
303
317
  prerelease: false
304
318
  version_requirements: !ruby/object:Gem::Requirement
305
319
  requirements:
306
320
  - - "~>"
307
321
  - !ruby/object:Gem::Version
308
- version: '3.142'
322
+ version: 4.1.0
309
323
  - !ruby/object:Gem::Dependency
310
324
  name: simplecov
311
325
  requirement: !ruby/object:Gem::Requirement
312
326
  requirements:
313
327
  - - "~>"
314
328
  - !ruby/object:Gem::Version
315
- version: 0.19.0
329
+ version: 0.21.0
316
330
  type: :runtime
317
331
  prerelease: false
318
332
  version_requirements: !ruby/object:Gem::Requirement
319
333
  requirements:
320
334
  - - "~>"
321
335
  - !ruby/object:Gem::Version
322
- version: 0.19.0
336
+ version: 0.21.0
323
337
  - !ruby/object:Gem::Dependency
324
338
  name: simplecov-cobertura
325
339
  requirement: !ruby/object:Gem::Requirement
326
340
  requirements:
327
341
  - - "~>"
328
342
  - !ruby/object:Gem::Version
329
- version: 1.3.1
330
- type: :runtime
331
- prerelease: false
332
- version_requirements: !ruby/object:Gem::Requirement
333
- requirements:
334
- - - "~>"
335
- - !ruby/object:Gem::Version
336
- version: 1.3.1
337
- - !ruby/object:Gem::Dependency
338
- name: system_test_html_screenshots
339
- requirement: !ruby/object:Gem::Requirement
340
- requirements:
341
- - - "~>"
342
- - !ruby/object:Gem::Version
343
- version: '0.2'
343
+ version: 2.1.0
344
344
  type: :runtime
345
345
  prerelease: false
346
346
  version_requirements: !ruby/object:Gem::Requirement
347
347
  requirements:
348
348
  - - "~>"
349
349
  - !ruby/object:Gem::Version
350
- version: '0.2'
350
+ version: 2.1.0
351
351
  - !ruby/object:Gem::Dependency
352
352
  name: w3c_rspec_validators
353
353
  requirement: !ruby/object:Gem::Requirement
@@ -515,10 +515,12 @@ files:
515
515
  - lib/decidim/dev/assets/import_proposals.xlsx
516
516
  - lib/decidim/dev/assets/import_proposals_broken.csv
517
517
  - lib/decidim/dev/assets/import_voting_census.csv
518
+ - lib/decidim/dev/assets/import_voting_census_only_headers.csv
518
519
  - lib/decidim/dev/assets/import_voting_census_with_ballot_styles.csv
519
520
  - lib/decidim/dev/assets/import_voting_census_without_headers.csv
520
521
  - lib/decidim/dev/assets/invalid.jpeg
521
522
  - lib/decidim/dev/assets/iso-8859-15.md
523
+ - lib/decidim/dev/assets/logo.png
522
524
  - lib/decidim/dev/assets/malicious.jpg
523
525
  - lib/decidim/dev/assets/participatory_processes.json
524
526
  - lib/decidim/dev/assets/participatory_processes_with_null.json
@@ -531,6 +533,8 @@ files:
531
533
  - lib/decidim/dev/assets/public_key.jwk
532
534
  - lib/decidim/dev/assets/public_key2.jwk
533
535
  - lib/decidim/dev/assets/public_key3.jwk
536
+ - lib/decidim/dev/assets/ssl-cert.pem
537
+ - lib/decidim/dev/assets/ssl-key.pem
534
538
  - lib/decidim/dev/assets/test_excel.xlsx
535
539
  - lib/decidim/dev/assets/verify_user_groups.csv
536
540
  - lib/decidim/dev/common_rake.rb
@@ -547,6 +551,7 @@ files:
547
551
  - lib/decidim/dev/test/rspec_support/active_job.rb
548
552
  - lib/decidim/dev/test/rspec_support/attachment_helpers.rb
549
553
  - lib/decidim/dev/test/rspec_support/authorization.rb
554
+ - lib/decidim/dev/test/rspec_support/autocomplete_select.rb
550
555
  - lib/decidim/dev/test/rspec_support/caching.rb
551
556
  - lib/decidim/dev/test/rspec_support/capybara.rb
552
557
  - lib/decidim/dev/test/rspec_support/capybara_data_picker.rb
@@ -557,6 +562,9 @@ files:
557
562
  - lib/decidim/dev/test/rspec_support/component_context.rb
558
563
  - lib/decidim/dev/test/rspec_support/confirmation_helpers.rb
559
564
  - lib/decidim/dev/test/rspec_support/content_processing.rb
565
+ - lib/decidim/dev/test/rspec_support/controller_example_group.rb
566
+ - lib/decidim/dev/test/rspec_support/data_consent.rb
567
+ - lib/decidim/dev/test/rspec_support/dynamic_attach.rb
560
568
  - lib/decidim/dev/test/rspec_support/factory_bot.rb
561
569
  - lib/decidim/dev/test/rspec_support/frontend.rb
562
570
  - lib/decidim/dev/test/rspec_support/gamification.rb
@@ -565,12 +573,13 @@ files:
565
573
  - lib/decidim/dev/test/rspec_support/html_matchers.rb
566
574
  - lib/decidim/dev/test/rspec_support/imports_controller_shared_examples.rb
567
575
  - lib/decidim/dev/test/rspec_support/migration.rb
576
+ - lib/decidim/dev/test/rspec_support/network_conditions_helpers.rb
568
577
  - lib/decidim/dev/test/rspec_support/orderly_matchers.rb
569
578
  - lib/decidim/dev/test/rspec_support/organization.rb
570
579
  - lib/decidim/dev/test/rspec_support/permissions_shared_examples.rb
571
580
  - lib/decidim/dev/test/rspec_support/rake_tasks.rb
572
- - lib/decidim/dev/test/rspec_support/react_select.rb
573
581
  - lib/decidim/dev/test/rspec_support/route_helpers.rb
582
+ - lib/decidim/dev/test/rspec_support/screenshot_helper.rb
574
583
  - lib/decidim/dev/test/rspec_support/time_helpers.rb
575
584
  - lib/decidim/dev/test/rspec_support/timezone.rb
576
585
  - lib/decidim/dev/test/rspec_support/translation_helpers.rb
@@ -583,6 +592,7 @@ files:
583
592
  - lib/decidim/dev/test/w3c_rspec_validators_overrides.rb
584
593
  - lib/decidim/dev/version.rb
585
594
  - lib/tasks/generators.rake
595
+ - lib/tasks/lighthouse_report.rake
586
596
  - lib/tasks/locale_checker.rake
587
597
  homepage: https://github.com/decidim/decidim
588
598
  licenses:
@@ -596,14 +606,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
596
606
  requirements:
597
607
  - - ">="
598
608
  - !ruby/object:Gem::Version
599
- version: '2.7'
609
+ version: '3.0'
600
610
  required_rubygems_version: !ruby/object:Gem::Requirement
601
611
  requirements:
602
- - - ">="
612
+ - - ">"
603
613
  - !ruby/object:Gem::Version
604
- version: '0'
614
+ version: 1.3.1
605
615
  requirements: []
606
- rubygems_version: 3.1.6
616
+ rubygems_version: 3.2.22
607
617
  signing_key:
608
618
  specification_version: 4
609
619
  summary: Decidim dev tools
@@ -1,29 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Adapted from https://github.com/JedWatson/react-select/issues/832#issuecomment-276441836
4
-
5
- module Capybara
6
- module ReactSelect
7
- def autocomplete_select(value, from:)
8
- within("div[data-autocomplete-for='#{from}']") do
9
- find(".Select-control").click
10
-
11
- find(".Select .Select-input input").native.send_keys(value[0..4])
12
- expect(page).to have_css(".Select-menu-outer") # select should be open now
13
-
14
- # This is a little funky because when the entered text forces the select to
15
- # wrap, it causes React to re-render. We need to get it to re-render
16
- # (if needed) by hovering.
17
- expect(page).to have_css(".Select-option", text: value)
18
- find(".Select-option", text: value).hover
19
- expect(page).to have_css(".Select-option", text: value)
20
- find(".Select-option", text: value).click
21
- expect(page).to have_css(".Select-value-label", text: value)
22
- end
23
- end
24
- end
25
- end
26
-
27
- RSpec.configure do |config|
28
- config.include Capybara::ReactSelect, type: :system
29
- end