@storybook/test 8.3.0-alpha.9 → 8.3.0-beta.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
@@ -25,7 +25,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
25
25
|
`,`${expectedLabel}:
|
26
26
|
${context.utils.EXPECTED_COLOR((0,import_redent.default)(display(context,expectedValue),2))}`,`${receivedLabel}:
|
27
27
|
${context.utils.RECEIVED_COLOR((0,import_redent.default)(display(context,receivedValue),2))}`].join(`
|
28
|
-
`)}function matches(textToMatch,matcher){return matcher instanceof RegExp?matcher.test(textToMatch):textToMatch.includes(String(matcher))}function deprecate(name,replacementText){console.warn(`Warning: ${name} has been deprecated and will be removed in future updates.`,replacementText)}function normalize(text){return text.replace(/\s+/g," ").trim()}function getTag(element){return element.tagName&&element.tagName.toLowerCase()}function getSelectValue({multiple,options}){let selectedOptions=[...options].filter(option=>option.selected);if(multiple)return[...selectedOptions].map(opt=>opt.value);if(selectedOptions.length!==0)return selectedOptions[0].value}function getInputValue(inputElement){switch(inputElement.type){case"number":return inputElement.value===""?null:Number(inputElement.value);case"checkbox":return inputElement.checked;default:return inputElement.value}}function getSingleElementValue(element){if(element)switch(element.tagName.toLowerCase()){case"input":return getInputValue(element);case"select":return getSelectValue(element);default:return element.value}}function toSentence(array,{wordConnector=", ",lastWordConnector=" and "}={}){return[array.slice(0,-1).join(wordConnector),array[array.length-1]].join(array.length>1?lastWordConnector:"")}function compareArraysAsSet(arr1,arr2){if(Array.isArray(arr1)&&Array.isArray(arr2))return[...new Set(arr1)].every(v=>new Set(arr2).has(v))}function toBeInTheDOM(element,container){return deprecate("toBeInTheDOM","Please use toBeInTheDocument for searching the entire document and toContainElement for searching a specific container."),element&&checkHtmlElement(element,toBeInTheDOM,this),container&&checkHtmlElement(container,toBeInTheDOM,this),{pass:container?container.contains(element):!!element,message:()=>[this.utils.matcherHint(`${this.isNot?".not":""}.toBeInTheDOM`,"element",""),"","Received:",` ${this.utils.printReceived(element&&element.cloneNode(!1))}`].join(`
|
28
|
+
`)}function matches(textToMatch,matcher){return matcher instanceof RegExp?matcher.test(textToMatch):textToMatch.includes(String(matcher))}function deprecate(name,replacementText){console.warn(`Warning: ${name} has been deprecated and will be removed in future updates.`,replacementText)}function normalize(text){return text.replace(/\s+/g," ").trim()}function getTag(element){return element.tagName&&element.tagName.toLowerCase()}function getSelectValue({multiple,options}){let selectedOptions=[...options].filter(option=>option.selected);if(multiple)return[...selectedOptions].map(opt=>opt.value);if(selectedOptions.length!==0)return selectedOptions[0].value}function getInputValue(inputElement){switch(inputElement.type){case"number":return inputElement.value===""?null:Number(inputElement.value);case"checkbox":return inputElement.checked;default:return inputElement.value}}var rolesSupportingValues=["meter","progressbar","slider","spinbutton"];function getAccessibleValue(element){if(rolesSupportingValues.includes(element.getAttribute("role")))return Number(element.getAttribute("aria-valuenow"))}function getSingleElementValue(element){if(element)switch(element.tagName.toLowerCase()){case"input":return getInputValue(element);case"select":return getSelectValue(element);default:return element.value??getAccessibleValue(element)}}function toSentence(array,{wordConnector=", ",lastWordConnector=" and "}={}){return[array.slice(0,-1).join(wordConnector),array[array.length-1]].join(array.length>1?lastWordConnector:"")}function compareArraysAsSet(arr1,arr2){if(Array.isArray(arr1)&&Array.isArray(arr2))return[...new Set(arr1)].every(v=>new Set(arr2).has(v))}function toBeInTheDOM(element,container){return deprecate("toBeInTheDOM","Please use toBeInTheDocument for searching the entire document and toContainElement for searching a specific container."),element&&checkHtmlElement(element,toBeInTheDOM,this),container&&checkHtmlElement(container,toBeInTheDOM,this),{pass:container?container.contains(element):!!element,message:()=>[this.utils.matcherHint(`${this.isNot?".not":""}.toBeInTheDOM`,"element",""),"","Received:",` ${this.utils.printReceived(element&&element.cloneNode(!1))}`].join(`
|
29
29
|
`)}}function toBeInTheDocument(element){(element!==null||!this.isNot)&&checkHtmlElement(element,toBeInTheDocument,this);let pass=element===null?!1:element.ownerDocument===element.getRootNode({composed:!0}),errorFound=()=>`expected document not to contain element, found ${this.utils.stringify(element.cloneNode(!0))} instead`,errorNotFound=()=>"element could not be found in the document";return{pass,message:()=>[this.utils.matcherHint(`${this.isNot?".not":""}.toBeInTheDocument`,"element",""),"",this.utils.RECEIVED_COLOR(this.isNot?errorFound():errorNotFound())].join(`
|
30
30
|
`)}}function toBeEmpty(element){return deprecate("toBeEmpty","Please use instead toBeEmptyDOMElement for finding empty nodes in the DOM."),checkHtmlElement(element,toBeEmpty,this),{pass:element.innerHTML==="",message:()=>[this.utils.matcherHint(`${this.isNot?".not":""}.toBeEmpty`,"element",""),"","Received:",` ${this.utils.printReceived(element.innerHTML)}`].join(`
|
31
31
|
`)}}function toBeEmptyDOMElement(element){return checkHtmlElement(element,toBeEmptyDOMElement,this),{pass:isEmptyElement(element),message:()=>[this.utils.matcherHint(`${this.isNot?".not":""}.toBeEmptyDOMElement`,"element",""),"","Received:",` ${this.utils.printReceived(element.innerHTML)}`].join(`
|
package/dist/index.mjs
CHANGED
@@ -29,7 +29,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
29
29
|
`,`${expectedLabel}:
|
30
30
|
${context.utils.EXPECTED_COLOR((0, import_redent.default)(display(context,expectedValue),2))}`,`${receivedLabel}:
|
31
31
|
${context.utils.RECEIVED_COLOR((0, import_redent.default)(display(context,receivedValue),2))}`].join(`
|
32
|
-
`)}function matches(textToMatch,matcher){return matcher instanceof RegExp?matcher.test(textToMatch):textToMatch.includes(String(matcher))}function deprecate(name,replacementText){console.warn(`Warning: ${name} has been deprecated and will be removed in future updates.`,replacementText);}function normalize(text){return text.replace(/\s+/g," ").trim()}function getTag(element){return element.tagName&&element.tagName.toLowerCase()}function getSelectValue({multiple,options}){let selectedOptions=[...options].filter(option=>option.selected);if(multiple)return [...selectedOptions].map(opt=>opt.value);if(selectedOptions.length!==0)return selectedOptions[0].value}function getInputValue(inputElement){switch(inputElement.type){case"number":return inputElement.value===""?null:Number(inputElement.value);case"checkbox":return inputElement.checked;default:return inputElement.value}}function getSingleElementValue(element){if(element)switch(element.tagName.toLowerCase()){case"input":return getInputValue(element);case"select":return getSelectValue(element);default:return element.value}}function toSentence(array,{wordConnector=", ",lastWordConnector=" and "}={}){return [array.slice(0,-1).join(wordConnector),array[array.length-1]].join(array.length>1?lastWordConnector:"")}function compareArraysAsSet(arr1,arr2){if(Array.isArray(arr1)&&Array.isArray(arr2))return [...new Set(arr1)].every(v=>new Set(arr2).has(v))}function toBeInTheDOM(element,container){return deprecate("toBeInTheDOM","Please use toBeInTheDocument for searching the entire document and toContainElement for searching a specific container."),element&&checkHtmlElement(element,toBeInTheDOM,this),container&&checkHtmlElement(container,toBeInTheDOM,this),{pass:container?container.contains(element):!!element,message:()=>[this.utils.matcherHint(`${this.isNot?".not":""}.toBeInTheDOM`,"element",""),"","Received:",` ${this.utils.printReceived(element&&element.cloneNode(!1))}`].join(`
|
32
|
+
`)}function matches(textToMatch,matcher){return matcher instanceof RegExp?matcher.test(textToMatch):textToMatch.includes(String(matcher))}function deprecate(name,replacementText){console.warn(`Warning: ${name} has been deprecated and will be removed in future updates.`,replacementText);}function normalize(text){return text.replace(/\s+/g," ").trim()}function getTag(element){return element.tagName&&element.tagName.toLowerCase()}function getSelectValue({multiple,options}){let selectedOptions=[...options].filter(option=>option.selected);if(multiple)return [...selectedOptions].map(opt=>opt.value);if(selectedOptions.length!==0)return selectedOptions[0].value}function getInputValue(inputElement){switch(inputElement.type){case"number":return inputElement.value===""?null:Number(inputElement.value);case"checkbox":return inputElement.checked;default:return inputElement.value}}var rolesSupportingValues=["meter","progressbar","slider","spinbutton"];function getAccessibleValue(element){if(rolesSupportingValues.includes(element.getAttribute("role")))return Number(element.getAttribute("aria-valuenow"))}function getSingleElementValue(element){if(element)switch(element.tagName.toLowerCase()){case"input":return getInputValue(element);case"select":return getSelectValue(element);default:return element.value??getAccessibleValue(element)}}function toSentence(array,{wordConnector=", ",lastWordConnector=" and "}={}){return [array.slice(0,-1).join(wordConnector),array[array.length-1]].join(array.length>1?lastWordConnector:"")}function compareArraysAsSet(arr1,arr2){if(Array.isArray(arr1)&&Array.isArray(arr2))return [...new Set(arr1)].every(v=>new Set(arr2).has(v))}function toBeInTheDOM(element,container){return deprecate("toBeInTheDOM","Please use toBeInTheDocument for searching the entire document and toContainElement for searching a specific container."),element&&checkHtmlElement(element,toBeInTheDOM,this),container&&checkHtmlElement(container,toBeInTheDOM,this),{pass:container?container.contains(element):!!element,message:()=>[this.utils.matcherHint(`${this.isNot?".not":""}.toBeInTheDOM`,"element",""),"","Received:",` ${this.utils.printReceived(element&&element.cloneNode(!1))}`].join(`
|
33
33
|
`)}}function toBeInTheDocument(element){(element!==null||!this.isNot)&&checkHtmlElement(element,toBeInTheDocument,this);let pass=element===null?!1:element.ownerDocument===element.getRootNode({composed:!0}),errorFound=()=>`expected document not to contain element, found ${this.utils.stringify(element.cloneNode(!0))} instead`,errorNotFound=()=>"element could not be found in the document";return {pass,message:()=>[this.utils.matcherHint(`${this.isNot?".not":""}.toBeInTheDocument`,"element",""),"",this.utils.RECEIVED_COLOR(this.isNot?errorFound():errorNotFound())].join(`
|
34
34
|
`)}}function toBeEmpty(element){return deprecate("toBeEmpty","Please use instead toBeEmptyDOMElement for finding empty nodes in the DOM."),checkHtmlElement(element,toBeEmpty,this),{pass:element.innerHTML==="",message:()=>[this.utils.matcherHint(`${this.isNot?".not":""}.toBeEmpty`,"element",""),"","Received:",` ${this.utils.printReceived(element.innerHTML)}`].join(`
|
35
35
|
`)}}function toBeEmptyDOMElement(element){return checkHtmlElement(element,toBeEmptyDOMElement,this),{pass:isEmptyElement(element),message:()=>[this.utils.matcherHint(`${this.isNot?".not":""}.toBeEmptyDOMElement`,"element",""),"","Received:",` ${this.utils.printReceived(element.innerHTML)}`].join(`
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@storybook/test",
|
3
|
-
"version": "8.3.0-
|
3
|
+
"version": "8.3.0-beta.1",
|
4
4
|
"description": "",
|
5
5
|
"keywords": [
|
6
6
|
"storybook"
|
@@ -46,9 +46,9 @@
|
|
46
46
|
"dependencies": {
|
47
47
|
"@storybook/csf": "^0.1.11",
|
48
48
|
"@storybook/global": "^5.0.0",
|
49
|
-
"@storybook/instrumenter": "8.3.0-
|
49
|
+
"@storybook/instrumenter": "8.3.0-beta.1",
|
50
50
|
"@testing-library/dom": "10.4.0",
|
51
|
-
"@testing-library/jest-dom": "6.
|
51
|
+
"@testing-library/jest-dom": "6.5.0",
|
52
52
|
"@testing-library/user-event": "14.5.2",
|
53
53
|
"@vitest/expect": "2.0.5",
|
54
54
|
"@vitest/spy": "2.0.5",
|
@@ -62,7 +62,7 @@
|
|
62
62
|
"typescript": "^5.3.2"
|
63
63
|
},
|
64
64
|
"peerDependencies": {
|
65
|
-
"storybook": "^8.3.0-
|
65
|
+
"storybook": "^8.3.0-beta.1"
|
66
66
|
},
|
67
67
|
"publishConfig": {
|
68
68
|
"access": "public"
|