coverageReporters: ['lcovonly', 'text'],
globals: {
'ts-jest': {
- diagnostics: false
- }
+ diagnostics: false,
+ },
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
moduleNameMapper: {
'^.+\\.(md|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/config/jest/FileStub.js',
- '^.+\\.css$': '<rootDir>/config/jest/CSSStub.js'
+ '^.+\\.css$': '<rootDir>/config/jest/CSSStub.js',
},
setupFiles: [
'<rootDir>/config/polyfills.ts',
'<rootDir>/config/jest/SetupEnzyme.ts',
- '<rootDir>/config/jest/SetupTestEnvironment.ts'
+ '<rootDir>/config/jest/SetupTestEnvironment.ts',
],
setupFilesAfterEnv: ['<rootDir>/config/jest/SetupReactTestingLibrary.ts'],
- snapshotSerializers: ['enzyme-to-json/serializer', 'jest-emotion'],
+ snapshotSerializers: ['enzyme-to-json/serializer', '@emotion/jest/serializer'],
testEnvironment: 'jsdom',
testPathIgnorePatterns: ['<rootDir>/config', '<rootDir>/node_modules', '<rootDir>/scripts'],
testRegex: '(/__tests__/.*|\\-test)\\.(ts|tsx|js)$',
'@swc/jest',
{
jsc: {
- target: 'es2018'
- }
- }
- ]
+ target: 'es2018',
+ },
+ },
+ ],
},
transformIgnorePatterns: ['/node_modules/(?!(d3-.+))/'],
reporters: [
ancestorSeparator: ' > ',
suiteNameTemplate: '{filename}',
classNameTemplate: '{classname}',
- titleTemplate: '{title}'
- }
+ titleTemplate: '{title}',
+ },
],
[
'./config/jest/ElasticSearchReporter.js',
{
- outputFilepath: '/tmp/ut-ts-web-monitoring.log'
- }
- ]
+ outputFilepath: '/tmp/ut-ts-web-monitoring.log',
+ },
+ ],
],
- testTimeout: 30000
+ testTimeout: 30000,
};
"fs-extra": "11.1.0",
"http-proxy": "1.18.1",
"jest": "29.3.1",
- "jest-emotion": "10.0.32",
"jest-environment-jsdom": "29.3.1",
"jest-junit": "13.0.0",
"jsdom": "20.0.3",
loading={false}
>
<a
- className=""
data-qualifier="TRK"
href="#"
onClick={[Function]}
"name": "master",
}
}
- className=""
expandable={true}
loading={false}
onExpand={[Function]}
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`should render correctly: branch with number of days 1`] = `
-<tr
- className=""
->
+<tr>
<td
className="nowrap"
>
`;
exports[`should render correctly: branch with previous version 1`] = `
-<tr
- className=""
->
+<tr>
<td
className="nowrap"
>
`;
exports[`should render correctly: branch with reference branch 1`] = `
-<tr
- className=""
->
+<tr>
<td
className="nowrap"
>
`;
exports[`should render correctly: branch with specific analysis 1`] = `
-<tr
- className=""
->
+<tr>
<td
className="nowrap"
>
`;
exports[`should render correctly: main branch with default 1`] = `
-<tr
- className=""
->
+<tr>
<td
className="nowrap"
>
innerRef={[Function]}
onClick={[Function]}
>
- <SortDescIcon
- className=""
- />
+ <SortDescIcon />
</ButtonIcon>
</Tooltip>
</div>
innerRef={[Function]}
onClick={[Function]}
>
- <SortAscIcon
- className=""
- />
+ <SortAscIcon />
</ButtonIcon>
</Tooltip>
</div>
innerRef={[Function]}
onClick={[Function]}
>
- <SortAscIcon
- className=""
- />
+ <SortAscIcon />
</ButtonIcon>
</Tooltip>
</div>
className="bordered-left little-spacer"
/>
<ProjectCardMeasure
- className=""
key="new_vulnerabilities"
label="metric.vulnerabilities.name"
metricKey="new_vulnerabilities"
className="bordered-left little-spacer"
/>
<ProjectCardMeasure
- className=""
iconKey="security_hotspots"
key="new_security_hotspots_reviewed"
label="projects.security_hotspots_reviewed"
className="bordered-left little-spacer"
/>
<ProjectCardMeasure
- className=""
key="new_code_smells"
label="metric.code_smells.name"
metricKey="new_code_smells"
className="bordered-left little-spacer"
/>
<ProjectCardMeasure
- className=""
key="vulnerabilities"
label="metric.vulnerabilities.name"
metricKey="vulnerabilities"
className="bordered-left little-spacer"
/>
<ProjectCardMeasure
- className=""
iconKey="security_hotspots"
key="security_hotspots_reviewed"
label="projects.security_hotspots_reviewed"
className="bordered-left little-spacer"
/>
<ProjectCardMeasure
- className=""
key="code_smells"
label="metric.code_smells.name"
metricKey="code_smells"
className="search-navigator-facet-list projects-facet-list"
>
<li
- className=""
key="1"
>
<button
className="search-navigator-facet-list projects-facet-list"
>
<li
- className=""
key="1"
>
<button
className="search-navigator-facet-list projects-facet-list"
>
<li
- className=""
key="1"
>
<button
</button>
</li>
<li
- className=""
key="2"
>
<button
</button>
</li>
<li
- className=""
key="3"
>
<button
className="search-navigator-facet-list projects-facet-list"
>
<li
- className=""
key="a"
>
<button
</button>
</li>
<li
- className=""
key="b"
>
<button
</button>
</li>
<li
- className=""
key="c"
>
<button
className="search-navigator-facet-list projects-facet-list"
>
<li
- className=""
key="1"
>
<button
</button>
</li>
<li
- className=""
key="2"
>
<button
</button>
</li>
<li
- className=""
key="3"
>
<button
</button>
</li>
<li
- className=""
key="3"
>
<button
className="search-navigator-facet-list projects-facet-list"
>
<li
- className=""
key="1"
>
<button
</button>
</li>
<li
- className=""
key="3"
>
<button
</button>
</li>
<li
- className=""
key="js"
>
<button
</button>
</li>
<li
- className=""
key="csharp"
>
<button
exports[`renders correctly: all permissions 1`] = `
<Fragment>
<ActionsDropdown
- className=""
label="quality_profiles.actions.name.JavaScript"
>
<ActionsDropdownItem
exports[`renders correctly: copy modal 1`] = `
<Fragment>
<ActionsDropdown
- className=""
label="quality_profiles.actions.name.JavaScript"
>
<ActionsDropdownItem
exports[`renders correctly: delete modal 1`] = `
<Fragment>
<ActionsDropdown
- className=""
label="quality_profiles.actions.name.JavaScript"
>
<ActionsDropdownItem
exports[`renders correctly: edit only 1`] = `
<Fragment>
<ActionsDropdown
- className=""
label="quality_profiles.actions.name.JavaScript"
>
<ActionsDropdownItem
exports[`renders correctly: extend modal 1`] = `
<Fragment>
<ActionsDropdown
- className=""
label="quality_profiles.actions.name.JavaScript"
>
<ActionsDropdownItem
exports[`renders correctly: no permissions 1`] = `
<Fragment>
<ActionsDropdown
- className=""
label="quality_profiles.actions.name.JavaScript"
>
<ActionsDropdownItem
exports[`renders correctly: rename modal 1`] = `
<Fragment>
<ActionsDropdown
- className=""
label="quality_profiles.actions.name.JavaScript"
>
<ActionsDropdownItem
exports[`should not allow to set a profile as the default if the profile has no active rules 1`] = `
<Fragment>
<ActionsDropdown
- className=""
label="quality_profiles.actions.name.JavaScript"
>
<ActionsDropdownItem
>
<FormattingTips />
</div>
- <div
- className=""
- >
+ <div>
<Button
className="little-spacer-right"
onClick={[Function]}
exports[`should render correctly: without status in badge 1`] = `
<Styled(div)>
<h3>
- <div
- className=""
- >
+ <div>
hotspots.status_option.TO_REVIEW
</div>
</h3>
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`should render correctly 1`] = `
-<tr
- className=""
->
+<tr>
<td
className="hide-overflow nowrap"
title="foo"
`;
exports[`should render correctly 2`] = `
-<tr
- className=""
->
+<tr>
<td
className="hide-overflow nowrap"
title="foo"
>
<li>
<a
- className=""
href="#"
onClick={[Function]}
>
</li>
<li>
<a
- className=""
href="#"
onClick={[Function]}
>
</li>
<li>
<a
- className=""
href="#"
onClick={[Function]}
>
t
</span>
<span
- className=""
key="2"
>
java.util.
ArrayList
</span>
<span
- className=""
key="4"
>
;
t
</span>
<span
- className=""
key="2"
>
java.util.
ArrayList
</span>
<span
- className=""
key="4"
>
;
t
</span>
<span
- className=""
key="2"
>
java.util.
ArrayList
</span>
<span
- className=""
key="4"
>
;
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`should render correctly: default 1`] = `
-<span
- className=""
->
+<span>
Foo
</span>
`;
overlay="foo bar"
placement="left"
>
- <span
- className=""
- >
+ <span>
Bar
</span>
</Tooltip>
overlay="foo bar"
placement="left"
>
- <span
- className=""
- >
+ <span>
Bar
<em
className="small little-spacer-left"
`;
exports[`should render correctly: no label 1`] = `
-<span
- className=""
->
+<span>
baz
</span>
`;
<li>
<ButtonPlain
aria-selected={false}
- className=""
onBlur={[Function]}
onClick={[Function]}
onFocus={[Function]}
<li>
<ButtonPlain
aria-selected={false}
- className=""
onBlur={[Function]}
onClick={[Function]}
onFocus={[Function]}
<li>
<ButtonPlain
aria-selected={false}
- className=""
onBlur={[Function]}
onClick={[Function]}
onFocus={[Function]}
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`should render correctly 1`] = `
-.emotion-6 {
+.emotion-0 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
border-right: 1px solid #e6e6e6;
}
-.emotion-0 {
+.emotion-2 {
display: block;
background-color: #4b9fd5;
height: 3px;
border-right: 1px solid #e6e6e6;
}
-.emotion-2 {
+.emotion-4 {
display: none;
background-color: #4b9fd5;
height: 3px;
data-s=""
>
- .emotion-6{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}
+ .emotion-0{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}
</style>
<style
data-emotion="css"
data-s=""
>
- .emotion-0{display:block;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
+ .emotion-2{display:block;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
</style>
<style
data-emotion="css"
data-s=""
>
- .emotion-2{display:none;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
+ .emotion-4{display:none;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
</style>
</head>,
"ctr": 8,
data-s=""
>
- .emotion-6{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}
+ .emotion-0{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}
</style>,
<style
data-emotion="css"
data-s=""
>
- .emotion-0{display:block;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
+ .emotion-2{display:block;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
</style>,
<style
data-emotion="css"
data-s=""
>
- .emotion-2{display:none;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
+ .emotion-4{display:none;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
</style>,
],
},
}
/>
<div
- className="boxed-tabs emotion-6"
+ className="boxed-tabs emotion-0"
role="tablist"
>
<Styled(button)
data-s=""
>
- .emotion-6{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}
+ .emotion-0{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}
</style>
<style
data-emotion="css"
data-s=""
>
- .emotion-0{display:block;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
+ .emotion-2{display:block;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
</style>
<style
data-emotion="css"
data-s=""
>
- .emotion-2{display:none;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
+ .emotion-4{display:none;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
</style>
</head>,
"ctr": 8,
data-s=""
>
- .emotion-6{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}
+ .emotion-0{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}
</style>,
<style
data-emotion="css"
data-s=""
>
- .emotion-0{display:block;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
+ .emotion-2{display:block;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
</style>,
<style
data-emotion="css"
data-s=""
>
- .emotion-2{display:none;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
+ .emotion-4{display:none;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
</style>,
],
},
data-s=""
>
- .emotion-6{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}
+ .emotion-0{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}
</style>
<style
data-emotion="css"
data-s=""
>
- .emotion-0{display:block;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
+ .emotion-2{display:block;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
</style>
<style
data-emotion="css"
data-s=""
>
- .emotion-2{display:none;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
+ .emotion-4{display:none;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
</style>
</head>,
"ctr": 8,
data-s=""
>
- .emotion-6{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}
+ .emotion-0{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}
</style>,
<style
data-emotion="css"
data-s=""
>
- .emotion-0{display:block;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
+ .emotion-2{display:block;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
</style>,
<style
data-emotion="css"
data-s=""
>
- .emotion-2{display:none;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
+ .emotion-4{display:none;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
</style>,
],
},
}
/>
<div
- className="emotion-0"
+ className="emotion-2"
/>
</Styled(div)>
labela
data-s=""
>
- .emotion-6{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}
+ .emotion-0{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}
</style>
<style
data-emotion="css"
data-s=""
>
- .emotion-0{display:block;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
+ .emotion-2{display:block;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
</style>
<style
data-emotion="css"
data-s=""
>
- .emotion-2{display:none;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
+ .emotion-4{display:none;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
</style>
</head>,
"ctr": 8,
data-s=""
>
- .emotion-6{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}
+ .emotion-0{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}
</style>,
<style
data-emotion="css"
data-s=""
>
- .emotion-0{display:block;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
+ .emotion-2{display:block;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
</style>,
<style
data-emotion="css"
data-s=""
>
- .emotion-2{display:none;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
+ .emotion-4{display:none;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
</style>,
],
},
data-s=""
>
- .emotion-6{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}
+ .emotion-0{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}
</style>
<style
data-emotion="css"
data-s=""
>
- .emotion-0{display:block;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
+ .emotion-2{display:block;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
</style>
<style
data-emotion="css"
data-s=""
>
- .emotion-2{display:none;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
+ .emotion-4{display:none;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
</style>
</head>,
"ctr": 8,
data-s=""
>
- .emotion-6{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}
+ .emotion-0{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}
</style>,
<style
data-emotion="css"
data-s=""
>
- .emotion-0{display:block;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
+ .emotion-2{display:block;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
</style>,
<style
data-emotion="css"
data-s=""
>
- .emotion-2{display:none;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
+ .emotion-4{display:none;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
</style>,
],
},
}
/>
<div
- className="emotion-2"
+ className="emotion-4"
/>
</Styled(div)>
labelb
data-s=""
>
- .emotion-6{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}
+ .emotion-0{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}
</style>
<style
data-emotion="css"
data-s=""
>
- .emotion-0{display:block;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
+ .emotion-2{display:block;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
</style>
<style
data-emotion="css"
data-s=""
>
- .emotion-2{display:none;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
+ .emotion-4{display:none;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
</style>
</head>,
"ctr": 8,
data-s=""
>
- .emotion-6{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}
+ .emotion-0{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}
</style>,
<style
data-emotion="css"
data-s=""
>
- .emotion-0{display:block;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
+ .emotion-2{display:block;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
</style>,
<style
data-emotion="css"
data-s=""
>
- .emotion-2{display:none;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
+ .emotion-4{display:none;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
</style>,
],
},
data-s=""
>
- .emotion-6{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}
+ .emotion-0{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}
</style>
<style
data-emotion="css"
data-s=""
>
- .emotion-0{display:block;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
+ .emotion-2{display:block;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
</style>
<style
data-emotion="css"
data-s=""
>
- .emotion-2{display:none;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
+ .emotion-4{display:none;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
</style>
</head>,
"ctr": 8,
data-s=""
>
- .emotion-6{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}
+ .emotion-0{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}
</style>,
<style
data-emotion="css"
data-s=""
>
- .emotion-0{display:block;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
+ .emotion-2{display:block;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
</style>,
<style
data-emotion="css"
data-s=""
>
- .emotion-2{display:none;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
+ .emotion-4{display:none;background-color:#4b9fd5;height:3px;width:100%;position:absolute;left:0;top:-1px;}
</style>,
],
},
}
/>
<div
- className="emotion-2"
+ className="emotion-4"
/>
</Styled(div)>
<span>
Foo
</label>
<input
- className=""
type="text"
/>
<div
Foo
</label>
<input
- className=""
type="text"
/>
</div>
exports[`should display all selected items 1`] = `
<FacetBox
- className=""
property="foo"
>
<FacetHeader
exports[`should render 1`] = `
<FacetBox
- className=""
property="foo"
>
<FacetHeader
exports[`should search 1`] = `
<FacetBox
- className=""
property="foo"
>
<FacetHeader
exports[`should search 2`] = `
<FacetBox
- className=""
property="foo"
>
<FacetHeader
exports[`should search 3`] = `
<FacetBox
- className=""
property="foo"
>
<FacetHeader
exports[`should search 4`] = `
<FacetBox
- className=""
property="foo"
>
<FacetHeader
exports[`should search 5`] = `
<FacetBox
- className=""
property="foo"
>
<FacetHeader
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { shallow } from 'enzyme';
+import { screen } from '@testing-library/react';
+import userEvent from '@testing-library/user-event';
import * as React from 'react';
+import { renderComponent } from '../../../helpers/testReactTestingUtils';
import PageShortcutsTooltip, { PageShortcutsTooltipProps } from '../PageShortcutsTooltip';
-it('should render correctly', () => {
- expect(shallowRender()).toMatchSnapshot('default');
- expect(shallowRender({ upAndDownLabel: 'foo', leftAndRightLabel: 'bar' })).toMatchSnapshot(
- 'with up/down and left/right labels'
- );
- expect(shallowRender({ leftLabel: 'baz' })).toMatchSnapshot('only left label');
- expect(shallowRender({ metaModifierLabel: 'funky' })).toMatchSnapshot('with meta label');
+const leftAndRightLabel = 'left & right';
+const leftLabel = 'left';
+const upAndDownLabel = 'up & down';
+const metaModifierLabel = 'meta';
+
+it('should render all the labels', async () => {
+ const user = userEvent.setup();
+
+ renderPageShortcutsTooltip({
+ leftAndRightLabel,
+ leftLabel,
+ upAndDownLabel,
+ metaModifierLabel,
+ });
+
+ await user.hover(screen.getByText('←'));
+
+ expect(await screen.findByText(leftAndRightLabel)).toBeInTheDocument();
+ expect(screen.getByText(leftLabel)).toBeInTheDocument();
+ expect(screen.getByText(upAndDownLabel)).toBeInTheDocument();
+ expect(screen.getByText(metaModifierLabel)).toBeInTheDocument();
+});
+
+it('should render left & right labels without up&down', async () => {
+ const user = userEvent.setup();
+
+ renderPageShortcutsTooltip({
+ leftAndRightLabel,
+ leftLabel,
+ });
+
+ await user.hover(screen.getByText('←'));
+
+ expect(await screen.findByText(leftAndRightLabel)).toBeInTheDocument();
+ expect(screen.getByText(leftLabel)).toBeInTheDocument();
});
-function shallowRender(props: Partial<PageShortcutsTooltipProps> = {}) {
- return shallow<PageShortcutsTooltipProps>(<PageShortcutsTooltip {...props} />);
+function renderPageShortcutsTooltip(props: Partial<PageShortcutsTooltipProps> = {}) {
+ return renderComponent(<PageShortcutsTooltip {...props} />);
}
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`should render banner alert with correct css 1`] = `
-.emotion-3 {
+.emotion-0 {
border: 1px solid;
border-radius: 2px;
margin-bottom: 8px;
display: block;
}
-.emotion-3:empty {
+.emotion-0:empty {
display: none;
}
-.emotion-3 a,
-.emotion-3 .button-link {
+.emotion-0 a,
+.emotion-0 .button-link {
border-color: #236a97;
}
-.emotion-2 {
+.emotion-1 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
box-sizing: border-box;
}
-.emotion-0 {
+.emotion-2 {
-webkit-flex: 0 0 auto;
-ms-flex: 0 0 auto;
flex: 0 0 auto;
border-color: #f4b1b0;
}
-.emotion-1 {
+.emotion-3 {
-webkit-flex: 1 1 auto;
-ms-flex: 1 1 auto;
flex: 1 1 auto;
<div
aria-label="alert.tooltip.error"
- class="alert alert-test emotion-3"
+ class="alert alert-test emotion-0"
id="error-message"
role="alert"
>
<div
- class="emotion-2"
+ class="emotion-1"
>
<div
- class="emotion-0"
+ class="emotion-2"
>
<svg
height="16"
</svg>
</div>
<div
- class="alert-content emotion-1"
+ class="alert-content emotion-3"
>
This is an error!
</div>
+++ /dev/null
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly: default 1`] = `
-<Tooltip
- overlay={
- <div
- className="small nowrap"
- >
- <div />
- </div>
- }
->
- <div
- aria-label="
- shortcuts.on_page.intro
-
-
-
-
- "
- className="page-shortcuts-tooltip note text-center display-inline-block"
- >
- <div>
- <span
- className="shortcut-button shortcut-button-tiny"
- >
- ↑
- </span>
- </div>
- <div>
- <span
- className="shortcut-button shortcut-button-tiny"
- >
- ←
- </span>
- <span
- className="shortcut-button shortcut-button-tiny"
- >
- ↓
- </span>
- <span
- className="shortcut-button shortcut-button-tiny"
- >
- →
- </span>
- </div>
- </div>
-</Tooltip>
-`;
-
-exports[`should render correctly: only left label 1`] = `
-<Tooltip
- overlay={
- <div
- className="small nowrap"
- >
- <div>
- <span
- className=""
- >
- <span
- className="shortcut-button spacer-right"
- >
- ←
- </span>
- baz
- </span>
- </div>
- </div>
- }
->
- <div
- aria-label="
- shortcuts.on_page.intro
-
-
- shortcuts.on_page.left_x.baz
-
- "
- className="page-shortcuts-tooltip note text-center display-inline-block"
- >
- <div>
- <span
- className="shortcut-button shortcut-button-tiny"
- >
- ↑
- </span>
- </div>
- <div>
- <span
- className="shortcut-button shortcut-button-tiny"
- >
- ←
- </span>
- <span
- className="shortcut-button shortcut-button-tiny"
- >
- ↓
- </span>
- <span
- className="shortcut-button shortcut-button-tiny"
- >
- →
- </span>
- </div>
- </div>
-</Tooltip>
-`;
-
-exports[`should render correctly: with meta label 1`] = `
-<Tooltip
- overlay={
- <div
- className="small nowrap"
- >
- <div />
- <div
- className="big-spacer-top big-padded-top bordered-top"
- >
- <span
- className="shortcut-button little-spacer-right"
- >
- alt
- </span>
- <span
- className="little-spacer-right"
- >
- +
- </span>
- <span
- className="shortcut-button little-spacer-right"
- >
- ↑
- </span>
- <span
- className="shortcut-button spacer-right"
- >
- ↓
- </span>
- <span
- className="shortcut-button little-spacer-right"
- >
- ←
- </span>
- <span
- className="shortcut-button spacer-right"
- >
- →
- </span>
- funky
- </div>
- </div>
- }
->
- <div
- aria-label="
- shortcuts.on_page.intro
-
-
-
- shortcuts.on_page.meta_x.funky
- "
- className="page-shortcuts-tooltip note text-center display-inline-block"
- >
- <div>
- <span
- className="shortcut-button shortcut-button-tiny"
- >
- ↑
- </span>
- </div>
- <div>
- <span
- className="shortcut-button shortcut-button-tiny"
- >
- ←
- </span>
- <span
- className="shortcut-button shortcut-button-tiny"
- >
- ↓
- </span>
- <span
- className="shortcut-button shortcut-button-tiny"
- >
- →
- </span>
- </div>
- </div>
-</Tooltip>
-`;
-
-exports[`should render correctly: with up/down and left/right labels 1`] = `
-<Tooltip
- overlay={
- <div
- className="small nowrap"
- >
- <div>
- <span>
- <span
- className="shortcut-button little-spacer-right"
- >
- ↑
- </span>
- <span
- className="shortcut-button spacer-right"
- >
- ↓
- </span>
- foo
- </span>
- <span
- className="big-spacer-left"
- >
- <span
- className="shortcut-button little-spacer-right"
- >
- ←
- </span>
- <span
- className="shortcut-button spacer-right"
- >
- →
- </span>
- bar
- </span>
- </div>
- </div>
- }
->
- <div
- aria-label="
- shortcuts.on_page.intro
- shortcuts.on_page.up_down_x.foo
- shortcuts.on_page.left_right_x.bar
-
-
- "
- className="page-shortcuts-tooltip note text-center display-inline-block"
- >
- <div>
- <span
- className="shortcut-button shortcut-button-tiny"
- >
- ↑
- </span>
- </div>
- <div>
- <span
- className="shortcut-button shortcut-button-tiny"
- >
- ←
- </span>
- <span
- className="shortcut-button shortcut-button-tiny"
- >
- ↓
- </span>
- <span
- className="shortcut-button shortcut-button-tiny"
- >
- →
- </span>
- </div>
- </div>
-</Tooltip>
-`;
languageName: node
linkType: hard
-"@types/jest@npm:^23.0.2":
- version: 23.3.14
- resolution: "@types/jest@npm:23.3.14"
- checksum: 0f8ec7c7ef16c35afb17bb1c83167bb847b2a577e0298caf3d828c43026f7544eb831d63fe71bb0eee28c8724389cbf57402e5b9fe87a22b255bd79ece2c3152
- languageName: node
- linkType: hard
-
"@types/jsdom@npm:^20.0.0":
version: 20.0.1
resolution: "@types/jsdom@npm:20.0.1"
fs-extra: 11.1.0
http-proxy: 1.18.1
jest: 29.3.1
- jest-emotion: 10.0.32
jest-environment-jsdom: 29.3.1
jest-junit: 13.0.0
jsdom: 20.0.3
languageName: node
linkType: hard
-"chalk@npm:^2.0.0, chalk@npm:^2.4.1":
+"chalk@npm:^2.0.0":
version: 2.4.2
resolution: "chalk@npm:2.4.2"
dependencies:
languageName: node
linkType: hard
-"css@npm:^2.2.1":
- version: 2.2.4
- resolution: "css@npm:2.2.4"
- dependencies:
- inherits: ^2.0.3
- source-map: ^0.6.1
- source-map-resolve: ^0.5.2
- urix: ^0.1.0
- checksum: a35d483c5ccc04bcde3b1e7393d58ad3eee1dd6956df0f152de38e46a17c0ee193c30eec6b1e59831ad0e74599385732000e95987fcc9cb2b16c6d951bae49e1
- languageName: node
- linkType: hard
-
"css@npm:^3.0.0":
version: 3.0.0
resolution: "css@npm:3.0.0"
languageName: node
linkType: hard
-"jest-emotion@npm:10.0.32":
- version: 10.0.32
- resolution: "jest-emotion@npm:10.0.32"
- dependencies:
- "@babel/runtime": ^7.5.5
- "@types/jest": ^23.0.2
- chalk: ^2.4.1
- css: ^2.2.1
- checksum: 9e7cb48bd71c24059d4d6575901ce23f7200d2b6b4b7ea5fe27818fb52bac2adfbe60398be12dc80d51cc5ca8d6d42933a33d118d651acea6793a60ed0b25c94
- languageName: node
- linkType: hard
-
"jest-environment-jsdom@npm:29.3.1":
version: 29.3.1
resolution: "jest-environment-jsdom@npm:29.3.1"
languageName: node
linkType: hard
-"resolve-url@npm:^0.2.1":
- version: 0.2.1
- resolution: "resolve-url@npm:0.2.1"
- checksum: 7b7035b9ed6e7bc7d289e90aef1eab5a43834539695dac6416ca6e91f1a94132ae4796bbd173cdacfdc2ade90b5f38a3fb6186bebc1b221cd157777a23b9ad14
- languageName: node
- linkType: hard
-
"resolve.exports@npm:^1.1.0":
version: 1.1.0
resolution: "resolve.exports@npm:1.1.0"
languageName: node
linkType: hard
-"source-map-resolve@npm:^0.5.2":
- version: 0.5.3
- resolution: "source-map-resolve@npm:0.5.3"
- dependencies:
- atob: ^2.1.2
- decode-uri-component: ^0.2.0
- resolve-url: ^0.2.1
- source-map-url: ^0.4.0
- urix: ^0.1.0
- checksum: c73fa44ac00783f025f6ad9e038ab1a2e007cd6a6b86f47fe717c3d0765b4a08d264f6966f3bd7cd9dbcd69e4832783d5472e43247775b2a550d6f2155d24bae
- languageName: node
- linkType: hard
-
"source-map-resolve@npm:^0.6.0":
version: 0.6.0
resolution: "source-map-resolve@npm:0.6.0"
languageName: node
linkType: hard
-"source-map-url@npm:^0.4.0":
- version: 0.4.0
- resolution: "source-map-url@npm:0.4.0"
- checksum: 63ed54045fcd7b4ec7ca17513f48fdc23b573eef679326ecf1a31333e1aaecc0a9c085adaa7d118283b160e65b71cc72da9e1385f2de4ac5ed68294e3920d719
- languageName: node
- linkType: hard
-
"source-map@npm:^0.5.0, source-map@npm:^0.5.7":
version: 0.5.7
resolution: "source-map@npm:0.5.7"
languageName: node
linkType: hard
-"urix@npm:^0.1.0":
- version: 0.1.0
- resolution: "urix@npm:0.1.0"
- checksum: 4c076ecfbf3411e888547fe844e52378ab5ada2d2f27625139011eada79925e77f7fbf0e4016d45e6a9e9adb6b7e64981bd49b22700c7c401c5fc15f423303b3
- languageName: node
- linkType: hard
-
"url-parse@npm:^1.5.3":
version: 1.5.10
resolution: "url-parse@npm:1.5.10"