bbc-a11y 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/bbc/a11y/cucumber_support/page.rb +5 -2
- data/lib/bbc/a11y/version +1 -1
- data/spec/bbc/a11y/cucumber_support/page_spec.rb +43 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c6b1965b456e7b2dfc8d99de5462ea914992a87
|
4
|
+
data.tar.gz: 01e2e192cfef634ac65ab484b302988d9fb40815
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 572d1b947bca6f1262fd1e30bebdf41f39b69d9f8223580d66a637c58434050fe0965991bfc5f8000429eda8ca16c534fa43fdb86ad7ad0b6fb6592a73336e70
|
7
|
+
data.tar.gz: be1b5c5c7226d24b497958dcfe642757a2ddf6c754ef18fc9ae55390c3286c02bdce20f5086766832a970f1ef5186b5e893bc28526c71982728ec5128a9a2088
|
@@ -58,8 +58,11 @@ module BBC
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def must_not_have_any_positive_tabindex_values
|
61
|
-
|
62
|
-
expect(
|
61
|
+
nodes_with_positive_tabindex = browser.all('[tabindex]').select { |node| node['tabindex'].to_i > 0 }
|
62
|
+
expect(nodes_with_positive_tabindex).to be_empty
|
63
|
+
nodes_with_zero_tabindex = browser.all('[tabindex]').select { |node| node['tabindex'].to_i == 0 }
|
64
|
+
bad_nodes_with_zero_tabindex = nodes_with_zero_tabindex.reject { |node| node.tag_name =~ /^a|button|input|select|textarea$/ }
|
65
|
+
expect(bad_nodes_with_zero_tabindex).to be_empty
|
63
66
|
end
|
64
67
|
|
65
68
|
def to_s
|
data/lib/bbc/a11y/version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.8
|
@@ -116,6 +116,49 @@ module BBC::A11y::CucumberSupport
|
|
116
116
|
to raise_error(RSpec::Expectations::ExpectationNotMetError)
|
117
117
|
end
|
118
118
|
end
|
119
|
+
|
120
|
+
context "a zero tabindex value on a focusable element (<a>, <button>, <input>, <select>, <textarea>)" do
|
121
|
+
let(:html) { <<-HTML }
|
122
|
+
<html>
|
123
|
+
<body>
|
124
|
+
<a tabindex="0">Important</a>
|
125
|
+
</body>
|
126
|
+
</html>
|
127
|
+
HTML
|
128
|
+
|
129
|
+
it "passes" do
|
130
|
+
expect { page.must_not_have_any_positive_tabindex_values }.not_to raise_error
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
context "a zero tabindex value on a non-focusable element" do
|
135
|
+
let(:html) { <<-HTML }
|
136
|
+
<html>
|
137
|
+
<body>
|
138
|
+
<p tabindex="0">Important</a>
|
139
|
+
</body>
|
140
|
+
</html>
|
141
|
+
HTML
|
142
|
+
|
143
|
+
it "fails" do
|
144
|
+
expect { page.must_not_have_any_positive_tabindex_values }.
|
145
|
+
to raise_error(RSpec::Expectations::ExpectationNotMetError)
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
149
|
+
context "a negative tabindex value" do
|
150
|
+
let(:html) { <<-HTML }
|
151
|
+
<html>
|
152
|
+
<body>
|
153
|
+
<p tabindex="-1">Important</a>
|
154
|
+
</body>
|
155
|
+
</html>
|
156
|
+
HTML
|
157
|
+
|
158
|
+
it "passes" do
|
159
|
+
expect { page.must_not_have_any_positive_tabindex_values }.not_to raise_error
|
160
|
+
end
|
161
|
+
end
|
119
162
|
end
|
120
163
|
|
121
164
|
describe '#to_s' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bbc-a11y
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Wynne
|
@@ -244,7 +244,7 @@ rubyforge_project:
|
|
244
244
|
rubygems_version: 2.0.14
|
245
245
|
signing_key:
|
246
246
|
specification_version: 4
|
247
|
-
summary: bbc-a11y-0.0.
|
247
|
+
summary: bbc-a11y-0.0.8
|
248
248
|
test_files:
|
249
249
|
- features/01_core-purpose.md
|
250
250
|
- features/02_validation.feature
|