-
Notifications
You must be signed in to change notification settings - Fork 532
enhancement: add missing "autocomplete", "placeholder" and "readonly"… #63
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
f5af70c
enhancement: add missing "autocomplete", "placeholder" and "readonly"…
a7e39d9
enhancement: add minlength attribute to textarea
5745318
fix: remove useless attributes
c645cea
fix: change test depending on changes
79bfee6
fix: re-added placeholder in field password and number (and correspon…
9ea47cc
Merge branch 'master' into LB_autocomplete
2e5e16b
fix: remove readonly attribute on select element
lionel-bijaoui ebf3f01
test: update to many test to check optional attributes
lionel-bijaoui ce3a91c
fix: update of attributes of Checklist, Text and Textarea fields.
lionel-bijaoui e618253
fix: remove comment, trailing space and duplicate from tests
lionel-bijaoui File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,5 +1,5 @@ | ||
import { expect } from "chai"; | ||
import { createVueField, trigger } from "../util"; | ||
import { createVueField, trigger, checkAttribute } from "../util"; | ||
|
||
import Vue from "vue"; | ||
import FieldEmail from "src/fields/fieldEmail.vue"; | ||
|
@@ -20,8 +20,9 @@ describe("fieldEmail.vue", function() { | |
type: "text", | ||
label: "E-mail", | ||
model: "email", | ||
readonly: false, | ||
placeholder: "Field placeholder" | ||
autocomplete: "off", | ||
placeholder: "Field placeholder", | ||
readonly: false | ||
}; | ||
let model = { email: "[email protected]" }; | ||
let input; | ||
|
@@ -38,9 +39,9 @@ describe("fieldEmail.vue", function() { | |
expect(input).to.be.defined; | ||
expect(input.type).to.be.equal("email"); | ||
expect(input.classList.contains("form-control")).to.be.true; | ||
expect(input.placeholder).to.be.equal(schema.placeholder); | ||
expect(input.readOnly).to.be.false; | ||
expect(input.disabled).to.be.false; | ||
// expect(input.placeholder).to.be.equal(schema.placeholder); | ||
// expect(input.readOnly).to.be.false; | ||
// expect(input.disabled).to.be.false; | ||
}); | ||
|
||
it("should contain the value", (done) => { | ||
|
@@ -50,19 +51,14 @@ describe("fieldEmail.vue", function() { | |
}); | ||
}); | ||
|
||
it("should set readOnly", (done) => { | ||
schema.readonly = true; | ||
vm.$nextTick( () => { | ||
expect(input.readOnly).to.be.true; | ||
done(); | ||
}); | ||
}); | ||
describe("check optional attribute", () => { | ||
// name which attributes you want to test and that's it. | ||
let attributes = ["autocomplete", "disabled", "placeholder", "readonly"]; | ||
|
||
it("should set disabled", (done) => { | ||
field.disabled = true; | ||
vm.$nextTick( () => { | ||
expect(input.disabled).to.be.true; | ||
done(); | ||
attributes.forEach(function(name) { | ||
it("should set " + name, function(done) { | ||
checkAttribute(name, vm, input, field, schema, done); | ||
}); | ||
}); | ||
}); | ||
|
||
|
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Please remove this old commented rows (other files too).
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.
Yeah, I wasn't sure you wanted to delete them or not, so meanwhile, I commented them. I will clean things now !
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.
You are mindful. But if we covered with your new code we can delete them. Because after 3 months, we won't know it is a skipped tests (what need to fix) or unneccessary :)
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.
Ok, make sense, sorry about that.
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.
Nop, if you ready, I will merge it. 🎉