Comments (19)
I am interested at the issue, but have some questions regarding to the libraries we used for testing. I looked at the example file HelloWorld.spec.js
, and learn that the test will mount an actual Vue component then verify the content through querySelector. Thought it's just an example, instead of querying each part for content, can we use
the library vue-test-utils
along with jest snapshot? Documentation? This will make the unit tests more efficient. For example this is an example where I shallow render the SelectedLicense
component, then capture the snapshot.
import { shallowMount } from '@vue/test-utils'
import SelectedLicense from '@/components/SelectedLicense'
describe('SelectedLicense', () => {
it('should render correct contents', () => {
const wrapper = shallowMount(SelectedLicense, {
propsData: {
fullLicenseName: '',
shortLicenseName: ''
}
})
expect(wrapper.element).toMatchSnapshot()
})
})
snapshot
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`HelloWorld.vue should render correct contents 1`] = `
<div
id="SelectedLicense"
>
<div
class="card chooser-selected"
>
<header
class="card-header"
>
<h2
class="title is-2"
>
Selected License
</h2>
</header>
<div
class="card-content"
>
<div>
<licenseiconography-stub
iconlist=","
/>
<div
class="selected-license-names"
>
<b
class="selected-license-name"
>
</b>
<a
class="help"
href="chooser.selected_license_link"
>
</a>
</div>
</div>
<licensedescription-stub
selectedlicense=""
/>
</div>
</div>
</div>
`;
from chooser.
You're all good to start working on this issue! I just pushed some changes, please pull them to your fork before getting started.
RE using vue-testing-utils, I think this should be alright. However, please make sure to not just test the template, also test that the content (license name(s), the link to the license info, etc.) is being tested as well.
Some things to keep in mind:
- For components that require interaction, i.e. the IconSelector component, this will not replace nightwatch e2e testing.
- The component will not work correctly if empty strings are passed as props. The props must be valid license names. I would like to see multiple license names being tested as well, not just cc by :)
from chooser.
Hi @akmadian, I'm an Outreachy applicant and was wondering if this issue has been assigned already. If not, I'b interested in working on it. Thank you!
from chooser.
I only have the discussion about the tools we can use for testing, so I haven't start picking up the issue yet. Feel free to claim it if you wish.
from chooser.
Thanks @killvung, I have just being assigned other issues so I give this back to you :)
from chooser.
Hey @killvung, I'm going to free this issue up for others to take a shot at since It's been a while since you've posted in this thread, and there's no activity on your fork of the repo.
from chooser.
Hi, @akmadian, can I take up this issue as well?
I'm also an Outreachy applicant, by the way.
from chooser.
@obulat, I’m going to say no for now to try and give someone else a shot at an issue in the repo since you’ve already done one
from chooser.
Hey @akmadian, I am an Outreachy applicant. Has this issue been assigned, I would like to work on it if available?
from chooser.
@DevchamploO go ahead :)
from chooser.
Thanks, I'll get started!
from chooser.
Hey @DevchamploO, if I don't see any indication of progress on this issue in the next two days, I'll have to free up the issue so that someone else can work on it.
from chooser.
I'm gonna free this issue up because there have been long periods of inactivity, with the only progress being made when I warned the assignee that I was going to free it up if I didn't see more progress soon.
from chooser.
@akmadian I have made a contribution during the contribution period, can I also contribute to this?
from chooser.
Yep, go ahead! @onyijne
from chooser.
okay will start right away
from chooser.
Hey @onyijne, I haven't seen any progress on this issue in about a week. Please make some more progress in the next couple days, or I will unassign you so others have a chance to contribute.
from chooser.
from chooser.
Closing because no longer relevant, most tests will need to be rewritten after the redesign is done.
from chooser.
Related Issues (20)
- NodeJS version prerequisite required in documentation HOT 2
- Upgrade Cypress to latest HOT 5
- Long word in 'Attribution Details' step breaks the UI HOT 13
- Improper padding in "Confused? Need Help?" modals HOT 14
- [Feature] Minor UI fix for the License Chooser Page HOT 7
- [Feature] Show specific errors under input element whenever a user inputs a wrong/incorrect information HOT 1
- [Feature] Dockerize the App HOT 4
- Disable scroll on body of website when modal is active. HOT 4
- [Bug] Fix Typo in FAQs HOT 11
- [Bug] No Windows equivalent command for `build-component` in package.json HOT 3
- [Bug] Missing hyperlink in Help Modal HOT 4
- [Feature] The Growing Common Sections looks so messed up HOT 4
- [Bug] full license name should include "Creative Commons" HOT 7
- [Bug] Request to Update Twitter Icon to X HOT 5
- Invalid host header error in Gitpod HOT 2
- change the chooser so it links to license translation in same language as chooser HOT 5
- Use HTTPS links for the license chooser HOT 18
- [Bug] Creative Commons Icons are missing in Copy Area HOT 7
- [Bug] After finishing the form, clicking "Done" doesn't do anything HOT 1
- [Feature] Offer simple, comprehensive "download license statement" link for all formats HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chooser.