-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#29: Write template unit test for PixelUnit
Once file storage is implemented, the config file can be loaded for the test as well, which will allow testing of the page's function
- Loading branch information
1 parent
c751e31
commit d7186d6
Showing
3 changed files
with
31 additions
and
6 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
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,28 @@ | ||
import createWrapper from '../../../jest/script/wrapper' | ||
import PixelUnit from '@/pages/metamine/PixelUnit/PixelUnit.vue' | ||
|
||
// TODO handle config file loading once it has a location | ||
|
||
// import { promises } from 'fs' | ||
|
||
var wrapper = null | ||
|
||
describe('PixelUnit.vue', () => { | ||
beforeAll(async () => { | ||
// const configData = await promises.readFile('@/assets/lin-bilal-liu-10x10-c4v-15bit-static-dynamic.txt', { encoding: 'utf-8' }) | ||
global.fetch.mockReturnValueOnce(Promise.resolve({ | ||
text: () => '' | ||
})) | ||
wrapper = createWrapper(PixelUnit, {}) | ||
}) | ||
|
||
it('mounts properly', () => { | ||
expect(wrapper.exists()).toBeTruthy() | ||
}) | ||
|
||
it.skip('responds to clicks', () => { | ||
const grid = wrapper.find('#unit-cell') | ||
grid.trigger('click', { layerX: 15, layerY: 15 }) | ||
expect(wrapper.vm.geometryItems[0].value).toBe('000000000000001') | ||
}) | ||
}) |