Merge pull request #3056 from natac13/added-test-slot-machine-#2111
Added tests to JavaScript Give Slot Machine Some Style
This commit is contained in:
@ -1609,6 +1609,9 @@
|
||||
],
|
||||
"tests":[
|
||||
"assert((editor.match(/\\$\\(\\$\\(\\'\\.slot\\'\\)\\[\\d\\]\\)\\.html\\(\\'\\<img\\s?src\\s?=\\s?\"\\'\\s?\\+\\s?images\\[\\w+\\-1\\]\\s?\\+\\s?\\'\"\\>\\'\\);/gi) && editor.match(/\\$\\(\\$\\(\\'\\.slot\\'\\)\\[\\d\\]\\)\\.html\\(\\'\\<img\\s?src\\s?=\\s?\"\\'\\s?\\+\\s?images\\[\\w+\\-1\\]\\s?\\+\\s?\\'\"\\>\\'\\);/gi).length >= 3) || (editor.match(/\\$\\(\\$\\(\\\"\\.slot\\\"\\)\\[\\d\\]\\)\\.html\\(\\'\\<img\\s?src\\s?=\\s?\"\\'\\s?\\+\\s?images\\[\\w+\\-1\\]\\s?\\+\\s?\\'\"\\>\\'\\);/gi) && editor.match(/\\$\\(\\$\\(\\\"\\.slot\\\"\\)\\[\\d\\]\\)\\.html\\(\\'\\<img\\s?src\\s?=\\s?\"\\'\\s?\\+\\s?images\\[\\w+\\-1\\]\\s?\\+\\s?\\'\"\\>\\'\\);/gi).length >= 3), 'Use the provided code three times. One for each slot')",
|
||||
"assert(editor.match(/\\$\\(\\$\\(\\'\\.slot\\'\\)\\[0\\]\\)/gi), 'You should have used <code>$('.slot')[0]</code> at least once')",
|
||||
"assert(editor.match(/\\$\\(\\$\\(\\'\\.slot\\'\\)\\[1\\]\\)/gi), 'You should have used <code>$('.slot')[1]</code> at least once')",
|
||||
"assert(editor.match(/\\$\\(\\$\\(\\'\\.slot\\'\\)\\[2\\]\\)/gi), 'You should have used <code>$('.slot')[2]</code> at least once')",
|
||||
"assert(editor.match(/slotOne/gi) && editor.match(/slotOne/gi).length >= 7, 'You should have used the slotOne value at least once')",
|
||||
"assert(editor.match(/slotTwo/gi) && editor.match(/slotTwo/gi).length >= 8, 'You should have used the slotTwo value at least once')",
|
||||
"assert(editor.match(/slotThree/gi) && editor.match(/slotThree/gi).length >= 7, 'You should have used the slotThree value at least once')"
|
||||
|
Reference in New Issue
Block a user