Update broken specs

Updates specs that were broken due to a new prop being introduced in
GlTruncate.
parent e76d927d
......@@ -234,30 +234,36 @@ describe('Vulnerability list component', () => {
const { id, project, location } = newVulnerabilities[0];
const cell = findLocationCell(id);
expect(cell.text()).toContain(project.nameWithNamespace);
expect(findLocationTextWrapper(cell).props()).toEqual({
text: location.image,
position: 'middle',
});
expect(findLocationTextWrapper(cell).props()).toEqual(
expect.objectContaining({
text: location.image,
position: 'middle',
}),
);
});
it('should display the vulnerability locations for code', () => {
const { id, project, location } = newVulnerabilities[1];
const cell = findLocationCell(id);
expect(cell.text()).toContain(project.nameWithNamespace);
expect(findLocationTextWrapper(cell).props()).toEqual({
text: locationText(location),
position: 'middle',
});
expect(findLocationTextWrapper(cell).props()).toEqual(
expect.objectContaining({
text: locationText(location),
position: 'middle',
}),
);
});
it('should display the vulnerability locations for code with no line data', () => {
const { id, project, location } = newVulnerabilities[2];
const cell = findLocationCell(id);
expect(cell.text()).toContain(project.nameWithNamespace);
expect(findLocationTextWrapper(cell).props()).toEqual({
text: location.file,
position: 'middle',
});
expect(findLocationTextWrapper(cell).props()).toEqual(
expect.objectContaining({
text: location.file,
position: 'middle',
}),
);
});
it('should not display the vulnerability locations for vulnerabilities without a location', () => {
......@@ -271,10 +277,12 @@ describe('Vulnerability list component', () => {
const { id, project, location } = newVulnerabilities[5];
const cell = findLocationCell(id);
expect(cell.text()).toContain(project.nameWithNamespace);
expect(findLocationTextWrapper(cell).props()).toEqual({
text: location.path,
position: 'middle',
});
expect(findLocationTextWrapper(cell).props()).toEqual(
expect.objectContaining({
text: location.path,
position: 'middle',
}),
);
});
});
......@@ -295,10 +303,12 @@ describe('Vulnerability list component', () => {
const { id, project, location } = newVulnerabilities[0];
const cell = findLocationCell(id);
expect(cell.text()).not.toContain(project.nameWithNamespace);
expect(findLocationTextWrapper(cell).props()).toEqual({
text: location.image,
position: 'middle',
});
expect(findLocationTextWrapper(cell).props()).toEqual(
expect.objectContaining({
text: location.image,
position: 'middle',
}),
);
});
it('should display the detected time', () => {
......@@ -312,10 +322,12 @@ describe('Vulnerability list component', () => {
const { id, project, location } = newVulnerabilities[1];
const cell = findLocationCell(id);
expect(cell.text()).not.toContain(project.nameWithNamespace);
expect(findLocationTextWrapper(cell).props()).toEqual({
text: locationText(location),
position: 'middle',
});
expect(findLocationTextWrapper(cell).props()).toEqual(
expect.objectContaining({
text: locationText(location),
position: 'middle',
}),
);
});
it('should make the file path linkable', () => {
......@@ -334,10 +346,12 @@ describe('Vulnerability list component', () => {
const { id, project, location } = newVulnerabilities[2];
const cell = findLocationCell(id);
expect(cell.text()).not.toContain(project.nameWithNamespace);
expect(findLocationTextWrapper(cell).props()).toEqual({
text: location.file,
position: 'middle',
});
expect(findLocationTextWrapper(cell).props()).toEqual(
expect.objectContaining({
text: location.file,
position: 'middle',
}),
);
});
});
......
......@@ -219,30 +219,36 @@ describe('Vulnerability list component', () => {
const { id, project, location } = newVulnerabilities[0];
const cell = findLocationCell(id);
expect(cell.text()).toContain(project.nameWithNamespace);
expect(findLocationTextWrapper(cell).props()).toEqual({
text: location.image,
position: 'middle',
});
expect(findLocationTextWrapper(cell).props()).toEqual(
expect.objectContaining({
text: location.image,
position: 'middle',
}),
);
});
it('should display the vulnerability locations for code', () => {
const { id, project, location } = newVulnerabilities[1];
const cell = findLocationCell(id);
expect(cell.text()).toContain(project.nameWithNamespace);
expect(findLocationTextWrapper(cell).props()).toEqual({
text: locationText(location),
position: 'middle',
});
expect(findLocationTextWrapper(cell).props()).toEqual(
expect.objectContaining({
text: locationText(location),
position: 'middle',
}),
);
});
it('should display the vulnerability locations for code with no line data', () => {
const { id, project, location } = newVulnerabilities[2];
const cell = findLocationCell(id);
expect(cell.text()).toContain(project.nameWithNamespace);
expect(findLocationTextWrapper(cell).props()).toEqual({
text: location.file,
position: 'middle',
});
expect(findLocationTextWrapper(cell).props()).toEqual(
expect.objectContaining({
text: location.file,
position: 'middle',
}),
);
});
it('should not display the vulnerability locations for vulnerabilities without a location', () => {
......@@ -256,10 +262,12 @@ describe('Vulnerability list component', () => {
const { id, project, location } = newVulnerabilities[5];
const cell = findLocationCell(id);
expect(cell.text()).toContain(project.nameWithNamespace);
expect(findLocationTextWrapper(cell).props()).toEqual({
text: location.path,
position: 'middle',
});
expect(findLocationTextWrapper(cell).props()).toEqual(
expect.objectContaining({
text: location.path,
position: 'middle',
}),
);
});
});
......@@ -280,10 +288,12 @@ describe('Vulnerability list component', () => {
const { id, project, location } = newVulnerabilities[0];
const cell = findLocationCell(id);
expect(cell.text()).not.toContain(project.nameWithNamespace);
expect(findLocationTextWrapper(cell).props()).toEqual({
text: location.image,
position: 'middle',
});
expect(findLocationTextWrapper(cell).props()).toEqual(
expect.objectContaining({
text: location.image,
position: 'middle',
}),
);
});
it('should display the detected time', () => {
......@@ -297,10 +307,12 @@ describe('Vulnerability list component', () => {
const { id, project, location } = newVulnerabilities[1];
const cell = findLocationCell(id);
expect(cell.text()).not.toContain(project.nameWithNamespace);
expect(findLocationTextWrapper(cell).props()).toEqual({
text: locationText(location),
position: 'middle',
});
expect(findLocationTextWrapper(cell).props()).toEqual(
expect.objectContaining({
text: locationText(location),
position: 'middle',
}),
);
});
it('should make the file path linkable', () => {
......@@ -319,10 +331,12 @@ describe('Vulnerability list component', () => {
const { id, project, location } = newVulnerabilities[2];
const cell = findLocationCell(id);
expect(cell.text()).not.toContain(project.nameWithNamespace);
expect(findLocationTextWrapper(cell).props()).toEqual({
text: location.file,
position: 'middle',
});
expect(findLocationTextWrapper(cell).props()).toEqual(
expect.objectContaining({
text: location.file,
position: 'middle',
}),
);
});
});
......
......@@ -27,6 +27,7 @@ exports[`VersionRow renders 1`] = `
>
<span
class="gl-truncate"
data-testid="truncate-end-container"
title="@gitlab-org/package-15"
>
<span
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment