File tree 2 files changed +19
-1
lines changed
2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 12
12
<%= text %>
13
13
</ p >
14
14
<% end %>
15
- < section class ="app-c-banner<% if aside %> app-c-banner--aside <% end %> " aria-label ="Notice " lang ="en ">
15
+ < section
16
+ class ="app-c-banner<% if aside %> app-c-banner--aside <% end %> "
17
+ aria-label ="Notice "
18
+ lang ="en "
19
+ data-module ="ga4-link-tracker "
20
+ data-ga4-track-links-only
21
+ data-ga4-link ="<%= { event_name : "navigation" , type : "callout" } . to_json %> ">
16
22
<%= content_block %>
17
23
<% if aside %>
18
24
< p class ="app-c-banner__desc "> <%= aside %> </ p >
Original file line number Diff line number Diff line change @@ -43,4 +43,16 @@ def component_name
43
43
assert_select ".app-c-banner__desc" , text : "This was published under the 2010 to 2015 Conservative government"
44
44
assert_select ".app-c-banner__desc" , text : "This consultation ran from 9:30am on 30 January 2017 to 5pm on 28 February 2017"
45
45
end
46
+
47
+ test "renders a banner with GA4 tracking" do
48
+ render_component (
49
+ title : "Summary" ,
50
+ text : "This was published under the 2010 to 2015 Conservative government" ,
51
+ aside : "This consultation ran from 9:30am on 30 January 2017 to 5pm on 28 February 2017" ,
52
+ )
53
+
54
+ assert_select ".app-c-banner--aside[data-module=ga4-link-tracker]"
55
+ assert_select ".app-c-banner--aside[data-ga4-track-links-only]"
56
+ assert_select ".app-c-banner--aside[data-ga4-link='{\" event_name\" :\" navigation\" ,\" type\" :\" callout\" }']"
57
+ end
46
58
end
You can’t perform that action at this time.
0 commit comments