I have a question about loki and visual regression tests for which I cannot really supply much of example code, but maybe somebody has come across this problem. I have table components which are captured by loki with the long bottom space beneath them, which is undesirable. And the height of screenshot is much bigger than height
defined in configuration. How to fix it so that screenshot captures only component?
Loki config:
module.exports = {
configurations: {
'chrome.docker': {
target: 'chrome.docker',
width: 800,
height: 600,
disableAutomaticViewportHeight: false,
deviceScaleFactor: 1,
mobile: false,
},
},
chromeDockerImage: 'test example',
chromeDockerUseCopy: true,
diffingEngine: 'gm',
gm: {
tolerance: 0.0002,
},
};
I tried changing disableAutomaticViewportHeight
to true
and adding chromeSelector: "#root > *"
.
The reference I am using: https://loki.js.org/configuration.html
EDIT:
I managed to reduce the space significantly, by adding a parameter for loki in Table.stories.js like this:
parameters: {
some params ...,
loki: {
chromeSelector: 'div[data-test="table-container"]',
},
}
However, small portion of extra space below component is still there.