Skip to content

Commit

Permalink
update NameColumn tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholas-codecov committed May 10, 2024
1 parent c583546 commit 7fd328c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,18 @@ const server = setupServer()
const mockSingularImpactedFilesData = {
owner: {
repository: {
__typename: 'Repository',
pull: {
compareWithBase: {
__typename: 'Comparison',
impactedFile: {
headName: 'file A',
hashedPath: 'hashed-path',
isNewFile: true,
isRenamedFile: false,
isDeletedFile: false,
isCriticalFile: false,
changeCoverage: 58.333333333333336,
headCoverage: {
percentCovered: 90.23,
},
Expand All @@ -32,18 +36,22 @@ const mockSingularImpactedFilesData = {
patchCoverage: {
percentCovered: 27.43,
},
changeCoverage: 58.333333333333336,
segments: {
results: [
{
header: '@@ -0,0 1,45 @@',
hasUnintendedChanges: false,
lines: [
{
baseNumber: null,
headNumber: '1',
baseCoverage: null,
headCoverage: 'H',
content: 'export default class Calculator {',
coverageInfo: {
hitCount: null,
hitUploadIds: [],
},
},
],
},
Expand Down Expand Up @@ -136,17 +144,23 @@ describe('NameColumn', () => {
expect(queryClient.getQueryData()).toStrictEqual({
fileLabel: 'New',
headName: 'file A',
hashedPath: 'hashed-path',
isCriticalFile: false,
segments: [
{
header: '@@ -0,0 1,45 @@',
hasUnintendedChanges: false,
lines: [
{
baseCoverage: null,
baseNumber: null,
content: 'export default class Calculator {',
headCoverage: 'H',
headNumber: '1',
coverageInfo: {
hitCount: null,
hitUploadIds: [],
},
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@ const server = setupServer()
const mockSingularImpactedFilesData = {
owner: {
repository: {
__typename: 'Repository',
pull: {
compareWithBase: {
__typename: 'Comparison',
impactedFile: {
headName: 'file A',
hashedPath: 'hashed-path',
isNewFile: true,
isRenamedFile: false,
isDeletedFile: false,
Expand All @@ -37,13 +40,18 @@ const mockSingularImpactedFilesData = {
results: [
{
header: '@@ -0,0 1,45 @@',
hasUnintendedChanges: false,
lines: [
{
baseNumber: null,
headNumber: '1',
baseCoverage: null,
headCoverage: 'H',
content: 'export default class Calculator {',
coverageInfo: {
hitCount: null,
hitUploadIds: [],
},
},
],
},
Expand Down Expand Up @@ -135,17 +143,23 @@ describe('NameColumn', () => {
expect(queryClient.getQueryData()).toStrictEqual({
fileLabel: 'New',
headName: 'file A',
hashedPath: 'hashed-path',
isCriticalFile: false,
segments: [
{
header: '@@ -0,0 1,45 @@',
hasUnintendedChanges: false,
lines: [
{
baseCoverage: null,
baseNumber: null,
content: 'export default class Calculator {',
headCoverage: 'H',
headNumber: '1',
coverageInfo: {
hitCount: null,
hitUploadIds: [],
},
},
],
},
Expand Down

0 comments on commit 7fd328c

Please sign in to comment.