glib-web 3.21.0 → 3.22.0

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: 6a1d6390dceb59db91cdb5fea9a123375d9442af6941b74770881736a6f25de0
4
- data.tar.gz: 46bfd89ea540dfd8fc125c5c486595fad64d5a40fc55de365b66bf1fb8dbccce
3
+ metadata.gz: 61bf1dd4994bb6105fb043e7b7b0943cb44e4e418baf246556855816442d6293
4
+ data.tar.gz: 88902efc0cc5e18d925a1261106df0dca345f5880959dc2cbaca1a91938f83d4
5
5
  SHA512:
6
- metadata.gz: 4e3536a448117c3c53b26899cc02457dff0326386d187fd1f538d1169f677a2d231a1b3238ace6d53cca7ebbe0effd4b0319c59ec4477f90ec691a571a4c62ea
7
- data.tar.gz: 32ecff8bb25917bd35605764f4e34c8d52f17e5d89be17738aa5c5230bac8fec4bab40d69c32e470473ad1425338197e0c201b6026985443f6ed4d14a383d4b9
6
+ metadata.gz: 8b86a31567e3e1eeb2252d5e3fa72796e563873ee7ff72f394e322227a876c31267bc4462383c323ebba40f302fa5fc16be86703569b86ebec3607cbc8caa967
7
+ data.tar.gz: ebdd87d23e46513bfce6804d6d1ed3fd6004cd00fa9c57b706aace77350d0c13b8603a8344b5e285535286b8fbb8e0b3bbdd23aeb227597ea289709736822e7f
@@ -101,7 +101,6 @@ class Glib::JsonUi::ViewBuilder
101
101
  string :rightText
102
102
  action :onTypeStart
103
103
  action :onTypeEnd
104
- action :onClick
105
104
  end
106
105
 
107
106
  class Number < Text
@@ -277,18 +277,21 @@ class Glib::JsonUi::ViewBuilder
277
277
  end
278
278
 
279
279
  class Column < View
280
+ hash :xxl
280
281
  hash :xl
281
282
  hash :lg
282
283
  hash :md
283
284
  hash :sm
284
285
  hash :xs
285
286
 
287
+ hash :xxlOnly
286
288
  hash :xlOnly
287
289
  hash :lgOnly
288
290
  hash :mdOnly
289
291
  hash :smOnly
290
292
  hash :xsOnly
291
293
 
294
+ hash :xxlAndDown
292
295
  hash :xlAndDown
293
296
  hash :lgAndDown
294
297
  hash :mdAndDown
@@ -275,6 +275,7 @@ module Glib
275
275
  bool :showTitle
276
276
  bool :aboveLeftDrawer
277
277
  bool :collapseButtonsOnMobile
278
+ bool :showBreakpoint
278
279
  int :elevation
279
280
 
280
281
  # def leftButtons(block)
@@ -3,37 +3,110 @@ module Glib
3
3
  extend ActiveSupport::Concern
4
4
 
5
5
  included do
6
- project_root = Rails.root
7
- paths = Dir.glob(project_root + 'test/mailers/previews/*')
8
- paths.each do |file|
9
- require file
10
- end
6
+ extend ClassMethods
7
+ end
8
+
9
+ module ClassMethods
10
+ def generate_preview_tests
11
+ project_root = Rails.root
12
+ paths = Dir.glob(project_root + 'test/mailers/previews/*')
13
+ paths.each do |file|
14
+ require file
15
+ end
11
16
 
12
- ActionMailer::Preview.subclasses.each do |preview_class|
13
- preview = preview_class.new
17
+ ActionMailer::Preview.subclasses.each do |preview_class|
18
+ preview = preview_class.new
14
19
 
15
- preview_class.instance_methods(false).each do |mailer_method|
16
- test "mailer for #{preview_class}##{mailer_method}" do
17
- preview.send(mailer_method).deliver_now
20
+ preview_class.instance_methods(false).each do |mailer_method|
21
+ test "mailer for #{preview_class}##{mailer_method}" do
22
+ preview.send(mailer_method).deliver_now
18
23
 
19
- # See TimeFreezableMailer
20
- preview.try(:return_time_if_frozen)
24
+ # See TimeFreezableMailer
25
+ preview.try(:return_time_if_frozen)
21
26
 
22
- logfile = File.join(log_dir, "#{preview_class.name.underscore}##{mailer_method}.txt")
27
+ _assert_last_mail_body_unchanged("#{preview_class.name.underscore}##{mailer_method}")
23
28
 
24
- # Use rstrip to avoid trailing space issues
25
- expected = File.exist?(logfile) ? File.read(logfile).rstrip : ''
26
- last_delivery = ActionMailer::Base.deliveries.last
27
- result = last_delivery.html_part.body.raw_source.rstrip
29
+ # logfile = File.join(log_dir, "#{preview_class.name.underscore}##{mailer_method}.txt")
28
30
 
29
- logger = File.open(logfile, 'w')
30
- logger.puts result
31
- logger.close
31
+ # # Use rstrip to avoid trailing space issues
32
+ # expected = File.exist?(logfile) ? File.read(logfile).rstrip : ''
33
+ # # last_delivery = ActionMailer::Base.deliveries.last
34
+ # # result = last_delivery.html_part.body.raw_source.rstrip
32
35
 
33
- assert_equal expected, result, "Result mismatch! #{logfile.sub(/\.txt$/, '')}"
36
+ # # result = mails.last.html_part.body.raw_source.rstrip
37
+ # result = last_mail_body
38
+
39
+ # logger = File.open(logfile, 'w')
40
+ # logger.puts result
41
+ # logger.close
42
+
43
+ # assert_equal expected, result, "Result mismatch! #{logfile.sub(/\.txt$/, '')}"
44
+ end
34
45
  end
35
46
  end
36
47
  end
37
48
  end
49
+
50
+ def log_root_dir
51
+ raise 'Implementation needed'
52
+ end
53
+
54
+ # Overridable
55
+ def log_dir
56
+ File.expand_path(File.join(log_root_dir, "results/#{class_name.underscore}/"))
57
+ end
58
+
59
+ def reset_mails
60
+ ActionMailer::Base.deliveries = []
61
+ end
62
+
63
+ def mails
64
+ @mails ||= ActionMailer::Base.deliveries
65
+ end
66
+
67
+ def last_mail
68
+ raise 'Last mail does not exist' unless (mail = mails.last)
69
+
70
+ mail
71
+ end
72
+
73
+ def assert_mails_unchanged
74
+ mails.each do |mail|
75
+ assert_mail_unchanged(mail)
76
+ end
77
+ end
78
+
79
+ # TODO: Remove test result files that are not relevant anymore
80
+ def assert_mail_unchanged(mail)
81
+ # `method_name` refers to the name of the current test method.
82
+ dir = File.join(log_dir, method_name)
83
+ unless File.directory?(dir)
84
+ FileUtils.mkdir_p(dir)
85
+ end
86
+
87
+ mail.to.each do |recipient|
88
+ _assert_mail_body_unchanged("#{method_name}/#{recipient}", mail)
89
+ end
90
+ end
91
+
92
+ # def assert_last_mail_body_unchanged
93
+ # # `method_name` refers to the name of the current test method.
94
+ # _assert_mail_body_unchanged(method_name, last_mail)
95
+ # end
96
+
97
+ private
98
+ def _assert_mail_body_unchanged(log_path, mail)
99
+ file = File.join(log_dir, "#{log_path}.txt")
100
+
101
+ # Use rstrip to avoid trailing space issues
102
+ expected = File.exist?(file) ? File.read(file).rstrip : ''
103
+ result = mail.html_part.body.raw_source.rstrip
104
+
105
+ logger = File.open(file, 'w')
106
+ logger.puts result
107
+ logger.close
108
+
109
+ assert_equal expected, result, "Result mismatch! #{file.sub(/\.txt$/, '')}"
110
+ end
38
111
  end
39
112
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glib-web
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.21.0
4
+ version: 3.22.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''