|
8 | 8 | render_inline(described_class.new( |
9 | 9 | text_content: Cms::Mocks::RichBlocks.as_model, |
10 | 10 | image: Cms::Mocks::Image.as_model, |
11 | | - image_side: :left, |
| 11 | + image_side: "left", |
12 | 12 | image_link: "https://www.teachcomputing.test/test-page", |
13 | 13 | title: nil, |
14 | 14 | background_color: "light-grey" |
|
30 | 30 | it "should have link" do |
31 | 31 | expect(page).to have_link(href: "https://www.teachcomputing.test/test-page") |
32 | 32 | end |
| 33 | + |
| 34 | + it "has no i belong flag" do |
| 35 | + expect(page).to_not have_css(".cms-full-width-banner__media--with-flag") |
| 36 | + end |
| 37 | + |
| 38 | + it "has no corner flourish" do |
| 39 | + expect(page).to_not have_css(".cms-full-width-banner__media--with-flourish-left") |
| 40 | + expect(page).to_not have_css(".cms-full-width-banner__media--with-flourish-right") |
| 41 | + end |
33 | 42 | end |
34 | 43 |
|
35 | | - context "with heading" do |
| 44 | + context "with heading and right side image" do |
36 | 45 | let(:title) { Faker::Lorem.sentence } |
37 | 46 |
|
38 | 47 | before do |
39 | 48 | render_inline(described_class.new( |
40 | 49 | text_content: Cms::Mocks::RichBlocks.as_model, |
41 | 50 | image: Cms::Mocks::Image.as_model, |
42 | | - image_side: :left, |
| 51 | + image_side: "right", |
43 | 52 | image_link: nil, |
44 | 53 | title: |
45 | 54 | )) |
46 | 55 | end |
47 | 56 |
|
48 | | - it "show render heading" do |
| 57 | + it "renders the heading" do |
49 | 58 | expect(page).to have_css(".govuk-heading-l.cms-full-width-banner__heading", text: title) |
50 | 59 | end |
| 60 | + |
| 61 | + it "renders the image on the right" do |
| 62 | + expect(page).to have_css(".right-align") |
| 63 | + end |
51 | 64 | end |
52 | 65 |
|
53 | 66 | context "with border" do |
|
62 | 75 | )) |
63 | 76 | end |
64 | 77 |
|
65 | | - it "show render heading" do |
| 78 | + it "renders the border" do |
66 | 79 | expect(page).to have_css(".cms-full-width-banner-row.has-border") |
67 | 80 | end |
68 | 81 | end |
69 | 82 |
|
70 | | - context "with buttons" do |
| 83 | + context "with button" do |
71 | 84 | before do |
72 | 85 | render_inline(described_class.new( |
73 | 86 | text_content: Cms::Mocks::RichBlocks.as_model, |
|
80 | 93 | )) |
81 | 94 | end |
82 | 95 |
|
83 | | - it "show render button" do |
| 96 | + it "renders the button" do |
84 | 97 | expect(page).to have_css(".govuk-button") |
85 | 98 | end |
86 | 99 | end |
| 100 | + |
| 101 | + context "with i belong flag" do |
| 102 | + before do |
| 103 | + render_inline(described_class.new( |
| 104 | + text_content: Cms::Mocks::RichBlocks.as_model, |
| 105 | + image: Cms::Mocks::Image.as_model, |
| 106 | + image_side: "left", |
| 107 | + image_link: nil, |
| 108 | + title: nil, |
| 109 | + show_bottom_border: false, |
| 110 | + i_belong_flag: true |
| 111 | + )) |
| 112 | + end |
| 113 | + |
| 114 | + it "renders the i belong flag" do |
| 115 | + expect(page).to have_css(".cms-full-width-banner__media--with-flag") |
| 116 | + end |
| 117 | + end |
| 118 | + |
| 119 | + context "with corner flourish on the left" do |
| 120 | + before do |
| 121 | + render_inline(described_class.new( |
| 122 | + text_content: Cms::Mocks::RichBlocks.as_model, |
| 123 | + image: Cms::Mocks::Image.as_model, |
| 124 | + image_side: "left", |
| 125 | + image_link: nil, |
| 126 | + title: nil, |
| 127 | + show_bottom_border: false, |
| 128 | + i_belong_flag: false, |
| 129 | + corner_flourish: true |
| 130 | + )) |
| 131 | + end |
| 132 | + |
| 133 | + it "renders the left corner flourish" do |
| 134 | + expect(page).to have_css(".cms-full-width-banner__media--with-flourish-left") |
| 135 | + end |
| 136 | + end |
| 137 | + |
| 138 | + context "with corner flourish on the right" do |
| 139 | + before do |
| 140 | + render_inline(described_class.new( |
| 141 | + text_content: Cms::Mocks::RichBlocks.as_model, |
| 142 | + image: Cms::Mocks::Image.as_model, |
| 143 | + image_side: "right", |
| 144 | + image_link: nil, |
| 145 | + title: nil, |
| 146 | + show_bottom_border: false, |
| 147 | + i_belong_flag: false, |
| 148 | + corner_flourish: true |
| 149 | + )) |
| 150 | + end |
| 151 | + |
| 152 | + it "renders the right corner flourish" do |
| 153 | + expect(page).to have_css(".cms-full-width-banner__media--with-flourish-right") |
| 154 | + end |
| 155 | + end |
87 | 156 | end |
0 commit comments