-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(android): card view "touchFeedbackColor" property is ignored
Fixes TIMOB-28517
- Loading branch information
1 parent
02ad0c8
commit 03ada5d
Showing
3 changed files
with
148 additions
and
26 deletions.
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
@@ -0,0 +1,94 @@ | ||
/* | ||
* Appcelerator Titanium Mobile | ||
* Copyright (c) 2021 by Axway, Inc. All Rights Reserved. | ||
* Licensed under the terms of the Apache Public License | ||
* Please see the LICENSE included with this distribution for details. | ||
*/ | ||
/* eslint-env mocha */ | ||
/* eslint no-unused-expressions: "off" */ | ||
'use strict'; | ||
const should = require('./utilities/assertions'); | ||
|
||
describe.android('Titanium.UI.Android.CardView', function () { | ||
this.timeout(5000); | ||
|
||
let win; | ||
afterEach(done => { // fires after every test in sub-suites too... | ||
if (win && !win.closed) { | ||
win.addEventListener('close', function listener () { | ||
win.removeEventListener('close', listener); | ||
win = null; | ||
done(); | ||
}); | ||
win.close(); | ||
} else { | ||
win = null; | ||
done(); | ||
} | ||
}); | ||
|
||
it.iosBroken('Ti.UI.Android.CardView', () => { | ||
should(Ti.UI.Android.CardView).not.be.undefined(); | ||
}); | ||
|
||
it('.apiName', () => { | ||
const cardView = Ti.UI.Android.createCardView(); | ||
should(cardView).have.readOnlyProperty('apiName').which.is.a.String(); | ||
should(cardView.apiName).be.eql('Ti.UI.Android.CardView'); | ||
}); | ||
|
||
it('createCardView', (finish) => { | ||
should(Ti.UI.Android.createCardView).not.be.undefined(); | ||
should(Ti.UI.Android.createCardView).be.a.Function(); | ||
|
||
win = Ti.UI.createWindow(); | ||
win.add(Ti.UI.Android.createCardView()); | ||
win.addEventListener('postlayout', function listener() { | ||
win.removeEventListener('postlayout', listener); | ||
finish(); | ||
}); | ||
win.open(); | ||
}); | ||
|
||
it('.backgroundColor', (finish) => { | ||
win = Ti.UI.createWindow(); | ||
const cardView = Ti.UI.Android.createCardView({ | ||
backgroundColor: 'orange' | ||
}); | ||
should(cardView.backgroundColor).be.eql('orange'); | ||
win.add(cardView); | ||
win.addEventListener('postlayout', function listener() { | ||
win.removeEventListener('postlayout', listener); | ||
finish(); | ||
}); | ||
win.open(); | ||
}); | ||
|
||
it('.touchFeedback', (finish) => { | ||
win = Ti.UI.createWindow(); | ||
const cardView = Ti.UI.Android.createCardView({ | ||
touchFeedback: false | ||
}); | ||
should(cardView.touchFeedback).be.false(); | ||
win.add(cardView); | ||
win.addEventListener('postlayout', function listener() { | ||
win.removeEventListener('postlayout', listener); | ||
finish(); | ||
}); | ||
win.open(); | ||
}); | ||
|
||
it('.touchFeedbackColor', (finish) => { | ||
win = Ti.UI.createWindow(); | ||
const cardView = Ti.UI.Android.createCardView({ | ||
touchFeedbackColor: 'yellow' | ||
}); | ||
should(cardView.touchFeedbackColor).be.eql('yellow'); | ||
win.add(cardView); | ||
win.addEventListener('postlayout', function listener() { | ||
win.removeEventListener('postlayout', listener); | ||
finish(); | ||
}); | ||
win.open(); | ||
}); | ||
}); |