-
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unit test #388
base: master
Are you sure you want to change the base?
Unit test #388
Conversation
…ckdown into query-string
* loading Map style -> done * loading ui visibility statut -> WIP
* when we reload the page the style will gone , which needs to be fixed
* add lodash lib to manipulate the object * add query string param
* make overlay independet Component
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
✔️ Deploy Preview for dazzling-visvesvaraya-f47271 ready! 🔨 Explore the source changes: 92e66b2 🔍 Inspect the deploy log: https://app.netlify.com/sites/dazzling-visvesvaraya-f47271/deploys/60c316c27c7b2e0007aa2b13 😎 Browse the preview: https://deploy-preview-388--dazzling-visvesvaraya-f47271.netlify.app |
@@ -15,12 +15,15 @@ it('renders correctly when there are no items', () => { | |||
expect(tree).toMatchSnapshot(); | |||
}); | |||
|
|||
it('render Correctly with context data' , async () => { | |||
it('>>>render Correctly with context data' , async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do the >>>
mean? does it do something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noo it doesn't have any meaning :) lol
// query for element | ||
const element = tree.findByType("div"); | ||
|
||
expect(element.props.children.length).toEqual(4); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is good start, can we also check if the text or color of the item is "expected"
@@ -15,12 +15,15 @@ it('renders correctly when there are no items', () => { | |||
expect(tree).toMatchSnapshot(); | |||
}); | |||
|
|||
it('render Correctly with context data' , async () => { | |||
it('>>>render Correctly with context data' , async () => { | |||
const tree = renderer.create( | |||
<AppContext.Provider value={envMock}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking it might make sense for someone debugging this test in the future, if you edit the envMock
right before creating the const tree
so that when viewing the test code, it's easy to see what the expected content will be. for example:
let usedEnv = envMock
usedMock.components[1] = {
"name":"Legend",
"is_visible": true,
"data": [
{
"title": "mapLegend.no",
"worldStyle": "2"
},
}
then you also don't need to keep changing the mock for each test case
Manage this branch in SquashTest this branch here: https://unit-test-8zp3j.squash.io |
add test case for Legend component to include data from context