decidim-dev 0.27.5 → 0.27.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 97a5308fe5acbd383f506e3b3ab5fe6a9101f162547ec3f3bc9d1b89e92e8083
4
- data.tar.gz: a834814950d0ecb210cbcaa47e7643324ec688c8ba2a87d69d1aa3832228b53b
3
+ metadata.gz: 9ac7e9937fcd43734ebd6fad5495c15d70bbd81454197caad3c45d80e06d9c5d
4
+ data.tar.gz: 5ca6519902578c7a953f2b511cbf56e10669aa4b13c1fb36fcbac4680373913a
5
5
  SHA512:
6
- metadata.gz: 9eeba596be6522a72d056d3a4339fe2cb75b5f945d3136bdc0c5ae536e830bdc8fee747453562b75845892b9f6d99bdf2430a1c0cccfd94d45bce6f5e0081d3b
7
- data.tar.gz: 921b38d3e4cd49b1c2e5ea9af6e1fb6a269a9440c37b086cb058e90e1525883499bc25cbab1da149e58ee32851baf0ef6cd3773ebb417572309b7a61cc119c3a
6
+ metadata.gz: 7f69d8704016e65a829adc62a6777432f54a8603d7175bb33c34b833d9f40027a551cb3caf3937dd274ce7cdf48de79775a6c4bee87cf723a904072a5887d3a6
7
+ data.tar.gz: e546815986b6d6e8e3f8eaea2fff9f513d12ad31e27244da45ba87339025c98fb507967ab3c5da13a081eba00369ba1bffcdd47273287a35b948b1ede090c6c4
@@ -15,6 +15,12 @@ bg:
15
15
  dummy:
16
16
  settings:
17
17
  global:
18
+ guided: Насочвано въвеждане
19
+ guided_help: Помощен текст
20
+ guided_readonly: Дезактивирано въвеждане
21
+ guided_rich: Насочвано широко въвеждане
22
+ guided_rich_help_html: HTML <strong>помощен</strong> текст
23
+ guided_rich_readonly_html: HTML <strong>помощен</strong> текст за дезакривирано въвеждане
18
24
  readonly_attribute: Само за четене атрибут
19
25
  test: А тест
20
26
  test_choices:
@@ -23,6 +29,7 @@ bg:
23
29
  c: В избор
24
30
  test_options:
25
31
  bar: Нещо1
32
+ baz: Baz
26
33
  foo: Нещо2
27
34
  step:
28
35
  endorsements_blocked: Одобряване забранено
@@ -30,6 +37,7 @@ bg:
30
37
  readonly_step_attribute: Само за четене стъпков атрибут
31
38
  test_options:
32
39
  bar: Нещо1
40
+ baz: Baz
33
41
  foo: Нещо2
34
42
  dummy:
35
43
  admin:
@@ -0,0 +1 @@
1
+ he:
@@ -20,8 +20,8 @@ hu:
20
20
  bar: Oszlop
21
21
  foo: foo
22
22
  step:
23
- endorsements_blocked: Jóváhagyások letiltva
24
- endorsements_enabled: Jóváhagyások engedélyezve
23
+ endorsements_blocked: Támogatások letiltva
24
+ endorsements_enabled: Támogatások engedélyezve
25
25
  test_options:
26
26
  bar: Oszlop
27
27
  foo: foo
@@ -15,6 +15,12 @@ pl:
15
15
  dummy:
16
16
  settings:
17
17
  global:
18
+ guided: Kierowane wprowadzanie danych
19
+ guided_help: Tekst pomocy
20
+ guided_readonly: Zablokowane pole wprowadzania danych
21
+ guided_rich: Kierowane i rozbudowane wprowadzanie danych
22
+ guided_rich_help_html: Tekst HTML <strong>pomocy</strong>
23
+ guided_rich_readonly_html: Treść HTML <strong>pomocy</strong> dla wyłączonego wprowadzania
18
24
  readonly_attribute: Atrybut tylko do odczytu
19
25
  test: Test A
20
26
  test_choices:
@@ -23,6 +29,7 @@ pl:
23
29
  c: Opcja C
24
30
  test_options:
25
31
  bar: Bar
32
+ baz: Baz
26
33
  foo: Foo
27
34
  step:
28
35
  endorsements_blocked: Możliwość rekomendacji zablokowana
@@ -30,6 +37,7 @@ pl:
30
37
  readonly_step_attribute: Atrybut kroku tylko do odczytu
31
38
  test_options:
32
39
  bar: Bar
40
+ baz: Baz
33
41
  foo: Foo
34
42
  dummy:
35
43
  admin:
@@ -29,6 +29,7 @@ pt-BR:
29
29
  c: Escolha C
30
30
  test_options:
31
31
  bar: Bar
32
+ baz: Baz
32
33
  foo: Foo
33
34
  step:
34
35
  endorsements_blocked: Endossos bloqueados
@@ -36,6 +37,7 @@ pt-BR:
36
37
  readonly_step_attribute: Atributo passo somente leitura
37
38
  test_options:
38
39
  bar: Bar
40
+ baz: Baz
39
41
  foo: Foo
40
42
  dummy:
41
43
  admin:
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ $LOAD_PATH.push File.expand_path("lib", __dir__)
4
+
5
+ # Maintain your gem's version:
6
+ require "decidim/dev/version"
7
+
8
+ # Describe your gem and declare its dependencies:
9
+ Gem::Specification.new do |s|
10
+ s.version = Decidim::Dev.version
11
+ s.authors = ["Josep Jaume Rey Peroy", "Marc Riera Casals", "Oriol Gual Oliva"]
12
+ s.email = ["josepjaume@gmail.com", "mrc2407@gmail.com", "oriolgual@gmail.com"]
13
+ s.license = "AGPL-3.0"
14
+ s.homepage = "https://github.com/decidim/decidim"
15
+ s.required_ruby_version = "~> 3.0.0"
16
+
17
+ s.name = "decidim-dev"
18
+ s.summary = "Decidim dev tools"
19
+ s.description = "Utilities and tools we need to develop Decidim"
20
+
21
+ s.files = Dir.chdir(__dir__) do
22
+ `git ls-files -z`.split("\x0").select do |f|
23
+ (File.expand_path(f) == __FILE__) ||
24
+ f.start_with?(*%w(app/ config/ db/ lib/ Rakefile README.md))
25
+ end
26
+ end
27
+
28
+ s.add_dependency "capybara", "~> 3.24"
29
+ s.add_dependency "decidim", Decidim::Dev.version
30
+ s.add_dependency "factory_bot_rails", "~> 4.8"
31
+
32
+ s.add_dependency "axe-core-rspec", "~> 4.1.0"
33
+ s.add_dependency "byebug", "~> 11.0"
34
+ s.add_dependency "db-query-matchers", "~> 0.10.0"
35
+ s.add_dependency "erb_lint", "~> 0.0.35"
36
+ s.add_dependency "faker", "= 2.19.0"
37
+ s.add_dependency "i18n-tasks", "~> 0.9.18"
38
+ s.add_dependency "mdl", "~> 0.5"
39
+ s.add_dependency "nokogiri", "~> 1.13"
40
+ s.add_dependency "parallel_tests", "~> 3.7"
41
+ s.add_dependency "puma", "~> 5.0"
42
+ s.add_dependency "rails-controller-testing", "~> 1.0"
43
+ s.add_dependency "rspec-cells", "~> 0.3.7"
44
+ s.add_dependency "rspec-html-matchers", "~> 0.9.1"
45
+ s.add_dependency "rspec_junit_formatter", "~> 0.3.0"
46
+ s.add_dependency "rspec-rails", "~> 4.0"
47
+ s.add_dependency "rspec-retry", "~> 0.6.2"
48
+ s.add_dependency "rubocop", "~> 1.28.0"
49
+ s.add_dependency "rubocop-rails", "~> 2.14"
50
+ s.add_dependency "rubocop-rspec", "~> 2.10"
51
+ s.add_dependency "selenium-webdriver", "~> 4.1.0"
52
+ s.add_dependency "simplecov", "~> 0.21.0"
53
+ s.add_dependency "simplecov-cobertura", "~> 2.1.0"
54
+ s.add_dependency "w3c_rspec_validators", "~> 0.3.0"
55
+ s.add_dependency "webmock", "~> 3.6"
56
+ s.add_dependency "wisper-rspec", "~> 1.0"
57
+ end
@@ -2,7 +2,11 @@
2
2
 
3
3
  FactoryBot.define do
4
4
  factory :dummy_component, parent: :component do
5
- name { Decidim::Components::Namer.new(participatory_space.organization.available_locales, :surveys).i18n_name }
5
+ transient do
6
+ skip_injection { false }
7
+ end
8
+
9
+ name { generate_component_name(participatory_space.organization.available_locales, :dummy, skip_injection: skip_injection) }
6
10
  manifest_name { :dummy }
7
11
  end
8
12
  end
@@ -32,6 +32,8 @@ Capybara.register_driver :headless_chrome do |app|
32
32
  options = ::Selenium::WebDriver::Chrome::Options.new
33
33
  options.args << "--headless"
34
34
  options.args << "--no-sandbox"
35
+ # Do not limit browser resources
36
+ options.args << "--disable-dev-shm-usage"
35
37
  options.args << if ENV["BIG_SCREEN_SIZE"].present?
36
38
  "--window-size=1920,3000"
37
39
  else
@@ -49,6 +51,7 @@ end
49
51
  port = rand(5000..6999)
50
52
  begin
51
53
  Socket.tcp("127.0.0.1", port, connect_timeout: 5).close
54
+ warn "Port #{port} is already in use, trying another one."
52
55
  rescue Errno::ECONNREFUSED
53
56
  # When connection is refused, the port is available for use.
54
57
  Capybara.server_port = port
@@ -56,7 +59,6 @@ end
56
59
  end
57
60
  end
58
61
 
59
- # In order to work with PWA apps, Chrome can't be run in headless mode, and requires
60
62
  # setting up special prefs and flags
61
63
  Capybara.register_driver :pwa_chrome do |app|
62
64
  options = ::Selenium::WebDriver::Chrome::Options.new
@@ -88,6 +90,8 @@ Capybara.register_driver :iphone do |app|
88
90
  options = ::Selenium::WebDriver::Chrome::Options.new
89
91
  options.args << "--headless"
90
92
  options.args << "--no-sandbox"
93
+ # Do not limit browser resources
94
+ options.args << "--disable-dev-shm-usage"
91
95
  options.add_emulation(device_name: "iPhone 6")
92
96
 
93
97
  Capybara::Selenium::Driver.new(
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Note that RSpec also provides `uses_transaction` but it needs to be specific
4
+ # with the name of the method which can easily break and the concurrency tests
5
+ # will anyways pass when run with the transactional mode. We want the same
6
+ # database to be used without transactions during the tests so that we can test
7
+ # concurrency correctly.
8
+ RSpec.shared_context "with concurrency" do
9
+ self.use_transactional_tests = false
10
+
11
+ after do
12
+ # Because the transactional tests are disabled, we need to manually clear
13
+ # the tables after the test.
14
+ connection = ActiveRecord::Base.connection
15
+ connection.disable_referential_integrity do
16
+ connection.tables.each do |table_name|
17
+ next if connection.select_value("SELECT COUNT(*) FROM #{table_name}").zero?
18
+
19
+ connection.execute("TRUNCATE #{table_name} CASCADE")
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ RSpec.configure do |config|
4
+ config.include Decidim::SanitizeHelper
5
+ end
@@ -25,7 +25,7 @@ module TranslationHelpers
25
25
  # field - the field that holds the translations
26
26
  # upcase - a boolean to indicate whether the string must be checked upcased or not.
27
27
  def have_i18n_content(field, upcase: false, strip_tags: false)
28
- have_content(i18n_content(field, upcase: upcase, strip_tags: strip_tags))
28
+ have_content(i18n_content(field, upcase: upcase, strip_tags: strip_tags).strip)
29
29
  end
30
30
 
31
31
  # Checks that the current page doesn't have some translated content. It strips
@@ -2,4 +2,4 @@
2
2
 
3
3
  require "webmock/rspec"
4
4
 
5
- WebMock.disable_net_connect!(allow_localhost: true, allow: %r{https://validator.w3.org/})
5
+ WebMock.disable_net_connect!(allow_localhost: true, allow: %r{https://validator\.w3\.org/})
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ RSpec.configure do |config|
4
+ config.before(:all) do
5
+ raise "Rails.root directory does not exist" unless Rails.root.exist?
6
+ raise "package.json file does not exist" unless Rails.root.join("package.json").exist?
7
+ raise "Node modules directory does not exist" unless Rails.root.join("node_modules").exist?
8
+
9
+ Dir.chdir(Rails.root) { Webpacker.compile }
10
+ rescue Errno::ENOENT
11
+ node_modules_contents = `ls #{Rails.root.join("node_modules")}`
12
+
13
+ message = <<~ERROR
14
+ There was an error during the Webpacker compilation
15
+ #{"=" * 80}
16
+ Node version: #{`node -v`}
17
+ #{"=" * 80}
18
+ NPM version: #{`npm -v`}
19
+ #{"=" * 80}
20
+ Node modules packages: #{`npm list`}
21
+ #{"=" * 80}
22
+ Node modules contents: #{node_modules_contents}
23
+ #{"=" * 80}
24
+ ERROR
25
+
26
+ raise message
27
+ end
28
+ end
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds the decidim-dev version.
5
5
  module Dev
6
6
  def self.version
7
- "0.27.5"
7
+ "0.27.7"
8
8
  end
9
9
  end
10
10
  end
@@ -16,8 +16,8 @@ namespace :decidim do
16
16
  host = "http://localhost:3000"
17
17
  urls = ["/"]
18
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
19
+ urls << ::Decidim::ResourceLocatorPresenter.new(Decidim::Meetings::Meeting.published.not_hidden.first).path
20
+ urls << ::Decidim::ResourceLocatorPresenter.new(Decidim::Proposals::Proposal.published.not_hidden.first).path
21
21
 
22
22
  # Update lighthouse configuration with the urls
23
23
  lighthouse_rc_path = Rails.root.join("../.lighthouserc.json")
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.27.5
4
+ version: 0.27.7
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: 2023-12-20 00:00:00.000000000 Z
13
+ date: 2024-07-16 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.27.5
35
+ version: 0.27.7
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.27.5
42
+ version: 0.27.7
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: factory_bot_rails
45
45
  requirement: !ruby/object:Gem::Requirement
@@ -110,6 +110,20 @@ dependencies:
110
110
  - - "~>"
111
111
  - !ruby/object:Gem::Version
112
112
  version: 0.0.35
113
+ - !ruby/object:Gem::Dependency
114
+ name: faker
115
+ requirement: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - '='
118
+ - !ruby/object:Gem::Version
119
+ version: 2.19.0
120
+ type: :runtime
121
+ prerelease: false
122
+ version_requirements: !ruby/object:Gem::Requirement
123
+ requirements:
124
+ - - '='
125
+ - !ruby/object:Gem::Version
126
+ version: 2.19.0
113
127
  - !ruby/object:Gem::Dependency
114
128
  name: i18n-tasks
115
129
  requirement: !ruby/object:Gem::Requirement
@@ -419,7 +433,6 @@ files:
419
433
  - app/views/decidim/dummy_resources/dummy_resources/foo.html.erb
420
434
  - app/views/decidim/dummy_resources/dummy_resources/show.html.erb
421
435
  - config/assets.rb
422
- - config/environment.rb
423
436
  - config/locales/am-ET.yml
424
437
  - config/locales/ar-SA.yml
425
438
  - config/locales/ar.yml
@@ -452,6 +465,7 @@ files:
452
465
  - config/locales/ga-IE.yml
453
466
  - config/locales/gl.yml
454
467
  - config/locales/gn-PY.yml
468
+ - config/locales/he-IL.yml
455
469
  - config/locales/hr-HR.yml
456
470
  - config/locales/hr.yml
457
471
  - config/locales/hu.yml
@@ -499,6 +513,7 @@ files:
499
513
  - config/locales/vi.yml
500
514
  - config/locales/zh-CN.yml
501
515
  - config/locales/zh-TW.yml
516
+ - decidim-dev.gemspec
502
517
  - lib/decidim-dev.rb
503
518
  - lib/decidim/dev.rb
504
519
  - lib/decidim/dev/assets/5000x5000.png
@@ -573,10 +588,12 @@ files:
573
588
  - lib/decidim/dev/test/rspec_support/comments.rb
574
589
  - lib/decidim/dev/test/rspec_support/component.rb
575
590
  - lib/decidim/dev/test/rspec_support/component_context.rb
591
+ - lib/decidim/dev/test/rspec_support/concurrency.rb
576
592
  - lib/decidim/dev/test/rspec_support/confirmation_helpers.rb
577
593
  - lib/decidim/dev/test/rspec_support/content_processing.rb
578
594
  - lib/decidim/dev/test/rspec_support/controller_example_group.rb
579
595
  - lib/decidim/dev/test/rspec_support/data_consent.rb
596
+ - lib/decidim/dev/test/rspec_support/decidim_sanitization.rb
580
597
  - lib/decidim/dev/test/rspec_support/dynamic_attach.rb
581
598
  - lib/decidim/dev/test/rspec_support/factory_bot.rb
582
599
  - lib/decidim/dev/test/rspec_support/frontend.rb
@@ -598,6 +615,7 @@ files:
598
615
  - lib/decidim/dev/test/rspec_support/translation_helpers.rb
599
616
  - lib/decidim/dev/test/rspec_support/warden.rb
600
617
  - lib/decidim/dev/test/rspec_support/webmock.rb
618
+ - lib/decidim/dev/test/rspec_support/webpacker.rb
601
619
  - lib/decidim/dev/test/rspec_support/wicked_pdf_assets_mock.rb
602
620
  - lib/decidim/dev/test/rspec_support/wisper.rb
603
621
  - lib/decidim/dev/test/rspec_support/z_download_helper.rb
@@ -617,16 +635,16 @@ require_paths:
617
635
  - lib
618
636
  required_ruby_version: !ruby/object:Gem::Requirement
619
637
  requirements:
620
- - - ">="
638
+ - - "~>"
621
639
  - !ruby/object:Gem::Version
622
- version: '3.0'
640
+ version: 3.0.0
623
641
  required_rubygems_version: !ruby/object:Gem::Requirement
624
642
  requirements:
625
643
  - - ">="
626
644
  - !ruby/object:Gem::Version
627
645
  version: '0'
628
646
  requirements: []
629
- rubygems_version: 3.4.22
647
+ rubygems_version: 3.5.14
630
648
  signing_key:
631
649
  specification_version: 4
632
650
  summary: Decidim dev tools
@@ -1,3 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Empty line for playing nice with tpope/vim-rails