Skip to content
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

chore: add mobile tests #9301

Merged
merged 15 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions packages/base/src/Device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ const internals = {
// Therefore the OS is detected as MACINTOSH instead of iOS and the device is a tablet if the Device.support.touch is true.
return /ipad/i.test(internals.userAgent) || (/Macintosh/i.test(internals.userAgent) && "ontouchend" in document);
},

_isPhone() {
detectTablet();
return internals.touch && !tablet;
},
};

let windowsVersion: number;
Expand Down Expand Up @@ -165,8 +170,7 @@ const isTablet = (): boolean => {
};

const isPhone = (): boolean => {
detectTablet();
return internals.touch && !tablet;
return internals._isPhone();
};

const isDesktop = (): boolean => {
Expand All @@ -193,6 +197,7 @@ const isAndroid = (): boolean => {
};

export {
internals,
supportsTouch,
isSafari,
isChrome,
Expand Down
1 change: 0 additions & 1 deletion packages/main/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ bundle.*.js
rollup.config*.js
wdio.conf.cjs
cypress.config.js
cypress/
postcss.config.cjs
package-scripts.cjs
.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import path from "path";

const __dirname = path.dirname(new URL(import.meta.url).pathname);

cypressConfig.component.supportFile = path.join(__dirname, "cypress/support/component.js");
cypressConfig.component.supportFile = path.join(__dirname, "cypress/support/component.ts");

export default cypressConfig;
Loading