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', () => { ...@@ -234,30 +234,36 @@ describe('Vulnerability list component', () => {
const { id, project, location } = newVulnerabilities[0]; const { id, project, location } = newVulnerabilities[0];
const cell = findLocationCell(id); const cell = findLocationCell(id);
expect(cell.text()).toContain(project.nameWithNamespace); expect(cell.text()).toContain(project.nameWithNamespace);
expect(findLocationTextWrapper(cell).props()).toEqual({ expect(findLocationTextWrapper(cell).props()).toEqual(
text: location.image, expect.objectContaining({
position: 'middle', text: location.image,
}); position: 'middle',
}),
);
}); });
it('should display the vulnerability locations for code', () => { it('should display the vulnerability locations for code', () => {
const { id, project, location } = newVulnerabilities[1]; const { id, project, location } = newVulnerabilities[1];
const cell = findLocationCell(id); const cell = findLocationCell(id);
expect(cell.text()).toContain(project.nameWithNamespace); expect(cell.text()).toContain(project.nameWithNamespace);
expect(findLocationTextWrapper(cell).props()).toEqual({ expect(findLocationTextWrapper(cell).props()).toEqual(
text: locationText(location), expect.objectContaining({
position: 'middle', text: locationText(location),
}); position: 'middle',
}),
);
}); });
it('should display the vulnerability locations for code with no line data', () => { it('should display the vulnerability locations for code with no line data', () => {
const { id, project, location } = newVulnerabilities[2]; const { id, project, location } = newVulnerabilities[2];
const cell = findLocationCell(id); const cell = findLocationCell(id);
expect(cell.text()).toContain(project.nameWithNamespace); expect(cell.text()).toContain(project.nameWithNamespace);
expect(findLocationTextWrapper(cell).props()).toEqual({ expect(findLocationTextWrapper(cell).props()).toEqual(
text: location.file, expect.objectContaining({
position: 'middle', text: location.file,
}); position: 'middle',
}),
);
}); });
it('should not display the vulnerability locations for vulnerabilities without a location', () => { it('should not display the vulnerability locations for vulnerabilities without a location', () => {
...@@ -271,10 +277,12 @@ describe('Vulnerability list component', () => { ...@@ -271,10 +277,12 @@ describe('Vulnerability list component', () => {
const { id, project, location } = newVulnerabilities[5]; const { id, project, location } = newVulnerabilities[5];
const cell = findLocationCell(id); const cell = findLocationCell(id);
expect(cell.text()).toContain(project.nameWithNamespace); expect(cell.text()).toContain(project.nameWithNamespace);
expect(findLocationTextWrapper(cell).props()).toEqual({ expect(findLocationTextWrapper(cell).props()).toEqual(
text: location.path, expect.objectContaining({
position: 'middle', text: location.path,
}); position: 'middle',
}),
);
}); });
}); });
...@@ -295,10 +303,12 @@ describe('Vulnerability list component', () => { ...@@ -295,10 +303,12 @@ describe('Vulnerability list component', () => {
const { id, project, location } = newVulnerabilities[0]; const { id, project, location } = newVulnerabilities[0];
const cell = findLocationCell(id); const cell = findLocationCell(id);
expect(cell.text()).not.toContain(project.nameWithNamespace); expect(cell.text()).not.toContain(project.nameWithNamespace);
expect(findLocationTextWrapper(cell).props()).toEqual({ expect(findLocationTextWrapper(cell).props()).toEqual(
text: location.image, expect.objectContaining({
position: 'middle', text: location.image,
}); position: 'middle',
}),
);
}); });
it('should display the detected time', () => { it('should display the detected time', () => {
...@@ -312,10 +322,12 @@ describe('Vulnerability list component', () => { ...@@ -312,10 +322,12 @@ describe('Vulnerability list component', () => {
const { id, project, location } = newVulnerabilities[1]; const { id, project, location } = newVulnerabilities[1];
const cell = findLocationCell(id); const cell = findLocationCell(id);
expect(cell.text()).not.toContain(project.nameWithNamespace); expect(cell.text()).not.toContain(project.nameWithNamespace);
expect(findLocationTextWrapper(cell).props()).toEqual({ expect(findLocationTextWrapper(cell).props()).toEqual(
text: locationText(location), expect.objectContaining({
position: 'middle', text: locationText(location),
}); position: 'middle',
}),
);
}); });
it('should make the file path linkable', () => { it('should make the file path linkable', () => {
...@@ -334,10 +346,12 @@ describe('Vulnerability list component', () => { ...@@ -334,10 +346,12 @@ describe('Vulnerability list component', () => {
const { id, project, location } = newVulnerabilities[2]; const { id, project, location } = newVulnerabilities[2];
const cell = findLocationCell(id); const cell = findLocationCell(id);
expect(cell.text()).not.toContain(project.nameWithNamespace); expect(cell.text()).not.toContain(project.nameWithNamespace);
expect(findLocationTextWrapper(cell).props()).toEqual({ expect(findLocationTextWrapper(cell).props()).toEqual(
text: location.file, expect.objectContaining({
position: 'middle', text: location.file,
}); position: 'middle',
}),
);
}); });
}); });
......
...@@ -219,30 +219,36 @@ describe('Vulnerability list component', () => { ...@@ -219,30 +219,36 @@ describe('Vulnerability list component', () => {
const { id, project, location } = newVulnerabilities[0]; const { id, project, location } = newVulnerabilities[0];
const cell = findLocationCell(id); const cell = findLocationCell(id);
expect(cell.text()).toContain(project.nameWithNamespace); expect(cell.text()).toContain(project.nameWithNamespace);
expect(findLocationTextWrapper(cell).props()).toEqual({ expect(findLocationTextWrapper(cell).props()).toEqual(
text: location.image, expect.objectContaining({
position: 'middle', text: location.image,
}); position: 'middle',
}),
);
}); });
it('should display the vulnerability locations for code', () => { it('should display the vulnerability locations for code', () => {
const { id, project, location } = newVulnerabilities[1]; const { id, project, location } = newVulnerabilities[1];
const cell = findLocationCell(id); const cell = findLocationCell(id);
expect(cell.text()).toContain(project.nameWithNamespace); expect(cell.text()).toContain(project.nameWithNamespace);
expect(findLocationTextWrapper(cell).props()).toEqual({ expect(findLocationTextWrapper(cell).props()).toEqual(
text: locationText(location), expect.objectContaining({
position: 'middle', text: locationText(location),
}); position: 'middle',
}),
);
}); });
it('should display the vulnerability locations for code with no line data', () => { it('should display the vulnerability locations for code with no line data', () => {
const { id, project, location } = newVulnerabilities[2]; const { id, project, location } = newVulnerabilities[2];
const cell = findLocationCell(id); const cell = findLocationCell(id);
expect(cell.text()).toContain(project.nameWithNamespace); expect(cell.text()).toContain(project.nameWithNamespace);
expect(findLocationTextWrapper(cell).props()).toEqual({ expect(findLocationTextWrapper(cell).props()).toEqual(
text: location.file, expect.objectContaining({
position: 'middle', text: location.file,
}); position: 'middle',
}),
);
}); });
it('should not display the vulnerability locations for vulnerabilities without a location', () => { it('should not display the vulnerability locations for vulnerabilities without a location', () => {
...@@ -256,10 +262,12 @@ describe('Vulnerability list component', () => { ...@@ -256,10 +262,12 @@ describe('Vulnerability list component', () => {
const { id, project, location } = newVulnerabilities[5]; const { id, project, location } = newVulnerabilities[5];
const cell = findLocationCell(id); const cell = findLocationCell(id);
expect(cell.text()).toContain(project.nameWithNamespace); expect(cell.text()).toContain(project.nameWithNamespace);
expect(findLocationTextWrapper(cell).props()).toEqual({ expect(findLocationTextWrapper(cell).props()).toEqual(
text: location.path, expect.objectContaining({
position: 'middle', text: location.path,
}); position: 'middle',
}),
);
}); });
}); });
...@@ -280,10 +288,12 @@ describe('Vulnerability list component', () => { ...@@ -280,10 +288,12 @@ describe('Vulnerability list component', () => {
const { id, project, location } = newVulnerabilities[0]; const { id, project, location } = newVulnerabilities[0];
const cell = findLocationCell(id); const cell = findLocationCell(id);
expect(cell.text()).not.toContain(project.nameWithNamespace); expect(cell.text()).not.toContain(project.nameWithNamespace);
expect(findLocationTextWrapper(cell).props()).toEqual({ expect(findLocationTextWrapper(cell).props()).toEqual(
text: location.image, expect.objectContaining({
position: 'middle', text: location.image,
}); position: 'middle',
}),
);
}); });
it('should display the detected time', () => { it('should display the detected time', () => {
...@@ -297,10 +307,12 @@ describe('Vulnerability list component', () => { ...@@ -297,10 +307,12 @@ describe('Vulnerability list component', () => {
const { id, project, location } = newVulnerabilities[1]; const { id, project, location } = newVulnerabilities[1];
const cell = findLocationCell(id); const cell = findLocationCell(id);
expect(cell.text()).not.toContain(project.nameWithNamespace); expect(cell.text()).not.toContain(project.nameWithNamespace);
expect(findLocationTextWrapper(cell).props()).toEqual({ expect(findLocationTextWrapper(cell).props()).toEqual(
text: locationText(location), expect.objectContaining({
position: 'middle', text: locationText(location),
}); position: 'middle',
}),
);
}); });
it('should make the file path linkable', () => { it('should make the file path linkable', () => {
...@@ -319,10 +331,12 @@ describe('Vulnerability list component', () => { ...@@ -319,10 +331,12 @@ describe('Vulnerability list component', () => {
const { id, project, location } = newVulnerabilities[2]; const { id, project, location } = newVulnerabilities[2];
const cell = findLocationCell(id); const cell = findLocationCell(id);
expect(cell.text()).not.toContain(project.nameWithNamespace); expect(cell.text()).not.toContain(project.nameWithNamespace);
expect(findLocationTextWrapper(cell).props()).toEqual({ expect(findLocationTextWrapper(cell).props()).toEqual(
text: location.file, expect.objectContaining({
position: 'middle', text: location.file,
}); position: 'middle',
}),
);
}); });
}); });
......
...@@ -27,6 +27,7 @@ exports[`VersionRow renders 1`] = ` ...@@ -27,6 +27,7 @@ exports[`VersionRow renders 1`] = `
> >
<span <span
class="gl-truncate" class="gl-truncate"
data-testid="truncate-end-container"
title="@gitlab-org/package-15" title="@gitlab-org/package-15"
> >
<span <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