-
-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docketeer 8.0 pull request
- Loading branch information
Showing
102 changed files
with
4,002 additions
and
2,588 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"workbench.localHistory.enabled": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,81 @@ | ||
/** Docketeer 7.0 | ||
* These tests do not work as enzyme is highly depricated and does not communicate with React 18 | ||
*/ | ||
import React from 'react'; | ||
import { describe, beforeEach, expect, test, jest } from '@jest/globals'; | ||
import Images from '../src/components/tabs/Images'; | ||
import { | ||
fireEvent, | ||
render, | ||
screen, | ||
} from '@testing-library/react'; | ||
|
||
// import React from 'react'; | ||
// import { configure, shallow } from "enzyme"; | ||
// import Adapter from "enzyme-adapter-react-16"; | ||
// import Images from '../src/components/tabs/Images'; | ||
const props = { | ||
imagesList: [ | ||
{ | ||
imgid: '2718634043dc', | ||
size: '111 MB', | ||
reps: 'Redis', | ||
tag: 16.4, | ||
}, | ||
], | ||
runIm: jest.fn(), | ||
removeIm: jest.fn(), | ||
onClick: jest.fn(), | ||
}; | ||
|
||
// configure({ adapter: new Adapter() }); | ||
// function shallowSetup() { | ||
// const props = { | ||
// imagesList: [ | ||
// { | ||
// resp: "node-php-something", | ||
// tag: "latest", | ||
// imgid: "fc266a46f885", | ||
// created: "toady", | ||
// size: "234mb", | ||
// }, | ||
// ], | ||
// }; | ||
// const enzymeWrapper = shallow(<Images {...props} />); | ||
// return { | ||
// props, | ||
// enzymeWrapper, | ||
// }; | ||
// } | ||
// describe("Shallow all of the properties of the Images", () => { | ||
// const { enzymeWrapper, props } = shallowSetup(); | ||
// it("Should render <div> tag in Images", () => { | ||
// expect(enzymeWrapper.type()).toEqual("div"); | ||
// expect( | ||
// enzymeWrapper.find("div.renderContainers").find("div").length | ||
// ).toEqual(8); | ||
// }); | ||
// it("Should render <h1> tag in Images with a title Images", () => { | ||
// expect(enzymeWrapper.containsMatchingElement(<h1>Images</h1>)).toBe( | ||
// true | ||
// ); | ||
// expect(enzymeWrapper.find(".tabTitle").text()).toEqual("Images"); | ||
// }); | ||
// it("Should render a div tag called runByImage and display all of the properties", () => { | ||
// expect(enzymeWrapper.find("div.runByButton").find("button").length).toEqual( | ||
// 1 | ||
// ); | ||
// expect(enzymeWrapper.find("div.runByButton").find("label").length).toEqual( | ||
// 1 | ||
// ); | ||
// expect(enzymeWrapper.find("div.runByButton").find("span").length).toEqual( | ||
// 1 | ||
// ); | ||
// expect(enzymeWrapper.find("div.runByButton").find("input").length).toEqual( | ||
// 1 | ||
// ); | ||
// }); | ||
// it(`render a div with a class name "containers" and all of it properties`, () => { | ||
// expect(enzymeWrapper.find("div.containers")); | ||
// expect(enzymeWrapper.find("div.box").find("div").length).toEqual(4); | ||
// expect(enzymeWrapper.find("div.box-label").find("h3").length).toEqual(1); | ||
// expect(enzymeWrapper.find("div.box-label").find("p").length).toEqual(1); | ||
// expect(enzymeWrapper.find("div.stopped-info").find("li").length).toEqual(2); | ||
// expect( | ||
// enzymeWrapper.find("div.stopped-button").find("button").length | ||
// ).toEqual(2); | ||
// }); | ||
// }); | ||
describe('Images', () => { | ||
|
||
//* Dummy Test | ||
describe('dummy test', () => { | ||
test('dummy test', () => { | ||
expect(2 + 2).toBe(4); | ||
beforeEach(() => { | ||
render(<Images {...props} />); | ||
screen.debug(); | ||
}); | ||
|
||
/* ----- search bar ----- */ | ||
describe('Seach bar testing', () => { | ||
test('Search accepts input', async () => { | ||
const search = screen.getByRole('textbox'); | ||
await fireEvent.change(search, { target: { value: 'search' } }); | ||
expect(search.value).toBe('search'); | ||
}); | ||
}); | ||
|
||
/* ----- button testing ------ */ | ||
|
||
describe('Run button on click', () => { | ||
test('Fires run button functionality', async () => { | ||
const runButton = screen.getByRole('button', { name: 'RUN' }); | ||
await fireEvent.click(runButton); | ||
expect(runButton).toBeCalled; | ||
}); | ||
}); | ||
|
||
|
||
describe('Remove button on click', () => { | ||
test('Fires remove button functionality', async () => { | ||
const removeButton = screen.getByRole('button', { name: 'REMOVE' }); | ||
await fireEvent.click(removeButton); | ||
expect(removeButton).toBeCalled; | ||
}); | ||
}); | ||
|
||
// currently gets stuck at window.runExec method --> reads undefined | ||
// describe('pull button on click', () => { | ||
// test('fires pull button functionality', () => { | ||
// const { container } = render(<Images {...props} />); | ||
// const pullButton = screen.getByRole('button', { name: 'Pull' }); | ||
// fireEvent.click(pullButton); | ||
// expect(pullButton).toBeCalled; | ||
// }); | ||
// }); | ||
|
||
describe('Images', () => { | ||
test('Renders an image if one is found', () => { | ||
const name = screen.getByText('Redis'); | ||
const id = screen.getByText('2718634043dc'); | ||
const size = screen.getByText('111 MB'); | ||
const tag = screen.getByText(16.4); | ||
expect(name).toBeDefined; | ||
expect(id).toBeDefined; | ||
expect(size).toBeDefined; | ||
expect(tag).toBeDefined; | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.