From 92a39091b5f29e33c3e2f0865decd6edb2ee1a4b Mon Sep 17 00:00:00 2001 From: Sam Noedel Date: Wed, 28 Dec 2016 20:01:00 -0800 Subject: [PATCH] Add .prop to chai-jquery assertions (#13393) * Add .prop to chai-jquery assertions * Fix tabs instead of spaces --- chai-jquery/chai-jquery-tests.ts | 5 +++++ chai-jquery/index.d.ts | 1 + 2 files changed, 6 insertions(+) diff --git a/chai-jquery/chai-jquery-tests.ts b/chai-jquery/chai-jquery-tests.ts index 52c54ab7ee..894acf9ca5 100644 --- a/chai-jquery/chai-jquery-tests.ts +++ b/chai-jquery/chai-jquery-tests.ts @@ -11,6 +11,11 @@ function test_attr() { expect($('#foo')).to.have.attr('class', 'container'); } +function test_prop() { + expect($('#foo')).to.have.prop('disabled'); + expect($('#foo')).to.have.prop('disabled', false); +} + function test_css() { expect($('#foo')).to.have.css('color'); expect($('#foo')).to.have.css('font-family', 'serif'); diff --git a/chai-jquery/index.d.ts b/chai-jquery/index.d.ts index 540928091c..839a57a370 100644 --- a/chai-jquery/index.d.ts +++ b/chai-jquery/index.d.ts @@ -10,6 +10,7 @@ declare namespace Chai { interface Assertion { attr: (name: string, value?: string) => Assertion; + prop: (name: string, value?: any) => Assertion; css: (name: string, value?: string) => Assertion; data: (name: string, value?: string) => Assertion; class(className: string): Assertion;