Skip to content

Commit 40c2091

Browse files
wnrmathiasbynens
authored andcommitted
Add .prop('placeholder') tests (failing for now)
These tests describe the functionality that #145 is asking for. Closes #147.
1 parent fdd8d25 commit 40c2091

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/tests.js

+7
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@
4949
strictEqual($el.prop('value'), '', '`$el.val("")` should change the `value` property');
5050
strictEqual(el.value, placeholder, '`$el.val("")` should change the `value` attribute');
5151
ok($el.hasClass('placeholder'), '`$el.val("")` should re-enable `placeholder` class');
52+
53+
// make sure the placeholder property works as expected.
54+
strictEqual($el.prop('placeholder'), placeholder, '$el.prop(`placeholder`) should return the placeholder value');
55+
$el.prop('placeholder', 'new placeholder');
56+
strictEqual($el.prop('placeholder'), 'new placeholder', '$el.prop(`placeholder`, <string>) should set the placeholder value');
57+
strictEqual($el.value, 'new placeholder', '$el.prop(`placeholder`, <string>) should update the displayed placeholder value');
58+
$el.prop('placeholder', placeholder);
5259
};
5360

5461
test('emulates placeholder for <input type=text>', function() {

0 commit comments

Comments
 (0)