- App.tsx: full navigation (Auth stack + Main tabs with 5 screens) - Auth: LoginScreen, RegisterScreen, ForgotPasswordScreen - HomeScreen: dashboard with IoT metrics, weather widget, alerts, quick actions, sensors - MapScreen: interactive map with layer toggles (6 layers) - MarketplaceScreen: categories (6), products (5), search - ChatScreen: AI chat with quick prompts (4), bot responses - ProfileScreen: user info, stats, menu (9 items), logout - AlertsScreen: alert list with severity, acknowledge - SensorsScreen: sensor list with type filters (6 types), search - ZonesScreen: zone cards with stats - SettingsScreen: language picker (FR/EN/ES/DE), privacy, about - Stores: iotStore (sensors, zones, alerts), notificationStore, uiStore + i18n - Hooks: useSensors, useAlerts, useNotifications, useLocation - Components: Card, Button, LoadingSpinner, ErrorBoundary, Header - Services: iotService, notificationService (with axios API client) - Utils: formatters (temp, AQI, noise, dates), validators (email, password, IBAN) - Theme: colors.ts with full design system (Blue Ocean palette) - Ditto: fixed MongoDB connection, new JWT secrets, official gateway image
73 lines
1.5 KiB
JavaScript
73 lines
1.5 KiB
JavaScript
'use strict';
|
|
|
|
var test = require('tape');
|
|
var hasSymbols = require('has-symbols/shams')();
|
|
var hasPropertyDescriptors = require('has-property-descriptors')();
|
|
|
|
var ownKeys = require('../');
|
|
|
|
/** @type {(a: PropertyKey, b: PropertyKey) => number} */
|
|
function comparator(a, b) {
|
|
if (typeof a === 'string' && typeof b === 'string') {
|
|
return a.localeCompare(b);
|
|
}
|
|
if (typeof a === 'number' && typeof b === 'number') {
|
|
return a - b;
|
|
}
|
|
return typeof a === 'symbol' ? 1 : -1;
|
|
}
|
|
|
|
test('ownKeys', function (t) {
|
|
t.equal(typeof ownKeys, 'function', 'is a function');
|
|
t.equal(
|
|
ownKeys.length,
|
|
1,
|
|
'has a length of 1'
|
|
);
|
|
|
|
t.test('basics', function (st) {
|
|
var obj = { a: 1, b: 2 };
|
|
if (hasPropertyDescriptors) {
|
|
Object.defineProperty(obj, 'c', {
|
|
configurable: true,
|
|
enumerable: false,
|
|
writable: true,
|
|
value: 3
|
|
});
|
|
}
|
|
|
|
st.deepEqual(
|
|
ownKeys(obj).sort(comparator),
|
|
(hasPropertyDescriptors ? ['a', 'b', 'c'] : ['a', 'b']).sort(comparator),
|
|
'includes non-enumerable properties'
|
|
);
|
|
|
|
st.end();
|
|
});
|
|
|
|
t.test('symbols', { skip: !hasSymbols }, function (st) {
|
|
/** @type {Record<PropertyKey, unknown>} */
|
|
var obj = { a: 1 };
|
|
var sym = Symbol('b');
|
|
obj[sym] = 2;
|
|
|
|
var nonEnumSym = Symbol('c');
|
|
Object.defineProperty(obj, nonEnumSym, {
|
|
configurable: true,
|
|
enumerable: false,
|
|
writable: true,
|
|
value: 3
|
|
});
|
|
|
|
st.deepEqual(
|
|
ownKeys(obj).sort(comparator),
|
|
['a', sym, nonEnumSym].sort(comparator),
|
|
'works with symbols, both enum and non-enum'
|
|
);
|
|
|
|
st.end();
|
|
});
|
|
|
|
t.end();
|
|
});
|