Add test coverage to CSS class generation (#2285)
The code that generates CSS is based on a lot of boolean conditions. The possible combinations of these grows exponentially as we add more conditions. Since most of the code is conditional on a single boolean, we tested the following: 1. All `false` 2. All `true` 3. Each individual flag set to `true` The methods tested are: * `StreamEntriesHelper#style_classes` * `StreamEntriesHelper#microformats_classes` * `StreamEntriesHelper#microformats_h_class`
This commit is contained in:
parent
6f0b3b069f
commit
0c2fe22bc1
2 changed files with 132 additions and 3 deletions
|
@ -31,9 +31,13 @@ module StreamEntriesHelper
|
|||
end
|
||||
|
||||
def microformats_h_class(status, is_predecessor, is_successor, include_threads)
|
||||
return 'h-cite' if is_predecessor || status.reblog || is_successor
|
||||
return 'h-entry' unless include_threads
|
||||
''
|
||||
if is_predecessor || status.reblog? || is_successor
|
||||
'h-cite'
|
||||
elsif include_threads
|
||||
''
|
||||
else
|
||||
'h-entry'
|
||||
end
|
||||
end
|
||||
|
||||
def rtl?(text)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue