mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-22 14:39:34 +01:00
add more test ids
This commit is contained in:
@@ -68,6 +68,8 @@ export const notesnook = {
|
|||||||
vault: 'vault_btn',
|
vault: 'vault_btn',
|
||||||
copy: 'icon-Copy',
|
copy: 'icon-Copy',
|
||||||
sync: 'btn-sync-now',
|
sync: 'btn-sync-now',
|
||||||
|
night: 'nightswitch',
|
||||||
|
color: (color) => 'icon-color-' + color,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
menu: {
|
menu: {
|
||||||
@@ -75,6 +77,22 @@ export const notesnook = {
|
|||||||
},
|
},
|
||||||
note: {
|
note: {
|
||||||
menu: 'note_menu',
|
menu: 'note_menu',
|
||||||
|
get:(index) => 'note-item-' + index
|
||||||
|
},
|
||||||
|
notebook: {
|
||||||
|
menu: 'notebook_menu',
|
||||||
|
get:(index) => 'notebook-item-' + index
|
||||||
|
},
|
||||||
|
topic: {
|
||||||
|
menu: 'topic_menu',
|
||||||
|
get:(index) => 'topic-item-' + index
|
||||||
|
},
|
||||||
|
tag: {
|
||||||
|
menu: 'tag_menu',
|
||||||
|
get:(index) => 'tag-item-' + index
|
||||||
|
},
|
||||||
|
list: {
|
||||||
|
getByType: (type) => 'list-' + type,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import React, {useState} from 'react';
|
import React, {useState} from 'react';
|
||||||
import {View} from 'react-native';
|
import {View} from 'react-native';
|
||||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||||
|
import { notesnook } from '../../../e2e/test.ids';
|
||||||
import {useTracked} from '../../provider';
|
import {useTracked} from '../../provider';
|
||||||
import {Actions} from '../../provider/Actions';
|
import {Actions} from '../../provider/Actions';
|
||||||
import {DDS} from '../../services/DeviceDetection';
|
import {DDS} from '../../services/DeviceDetection';
|
||||||
@@ -45,7 +46,7 @@ export const ActionSheetColorsSection = ({item,close}) => {
|
|||||||
<PressableButton
|
<PressableButton
|
||||||
type="accent"
|
type="accent"
|
||||||
accentColor={color.name.toLowerCase()}
|
accentColor={color.name.toLowerCase()}
|
||||||
testID={'icon-color-' + c}
|
testID={notesnook.ids.dialogs.actionsheet.color(c)}
|
||||||
key={color.value}
|
key={color.value}
|
||||||
onPress={async () => {
|
onPress={async () => {
|
||||||
await PremiumService.verify(async () => {
|
await PremiumService.verify(async () => {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import React, {createRef, useCallback, useEffect, useState} from 'react';
|
import React, {createRef, useCallback, useEffect, useState} from 'react';
|
||||||
import {Text, TextInput, TouchableOpacity, View} from 'react-native';
|
import {Text, TextInput, TouchableOpacity, View} from 'react-native';
|
||||||
|
import { notesnook } from '../../../e2e/test.ids';
|
||||||
import {useTracked} from '../../provider';
|
import {useTracked} from '../../provider';
|
||||||
import {Actions} from '../../provider/Actions';
|
import {Actions} from '../../provider/Actions';
|
||||||
import {
|
import {
|
||||||
@@ -249,6 +250,7 @@ export const ActionSheetTagsSection = ({item, close}) => {
|
|||||||
fontSize: SIZE.sm,
|
fontSize: SIZE.sm,
|
||||||
textAlignVertical: 'center',
|
textAlignVertical: 'center',
|
||||||
}}
|
}}
|
||||||
|
testID={notesnook.ids.dialogs.actionsheet.hashtagInput}
|
||||||
autoCapitalize="none"
|
autoCapitalize="none"
|
||||||
textAlignVertical="center"
|
textAlignVertical="center"
|
||||||
blurOnSubmit={false}
|
blurOnSubmit={false}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import {
|
|||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import Share from 'react-native-share';
|
import Share from 'react-native-share';
|
||||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||||
|
import { notesnook } from '../../../e2e/test.ids';
|
||||||
import {useTracked} from '../../provider';
|
import {useTracked} from '../../provider';
|
||||||
import {Actions} from '../../provider/Actions';
|
import {Actions} from '../../provider/Actions';
|
||||||
import {DDS} from '../../services/DeviceDetection';
|
import {DDS} from '../../services/DeviceDetection';
|
||||||
@@ -253,6 +254,7 @@ export const ActionSheetComponent = ({
|
|||||||
on: colors.night ? true : false,
|
on: colors.night ? true : false,
|
||||||
close: false,
|
close: false,
|
||||||
nopremium: true,
|
nopremium: true,
|
||||||
|
id:notesnook.ids.dialogs.actionsheet.night
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Pin',
|
name: 'Pin',
|
||||||
@@ -294,6 +296,7 @@ export const ActionSheetComponent = ({
|
|||||||
close: false,
|
close: false,
|
||||||
check: true,
|
check: true,
|
||||||
on: note.pinned,
|
on: note.pinned,
|
||||||
|
id:notesnook.ids.dialogs.actionsheet.pin
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Favorite',
|
name: 'Favorite',
|
||||||
@@ -312,6 +315,7 @@ export const ActionSheetComponent = ({
|
|||||||
close: false,
|
close: false,
|
||||||
check: true,
|
check: true,
|
||||||
on: note.favorite,
|
on: note.favorite,
|
||||||
|
id:notesnook.ids.dialogs.actionsheet.favorite
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: isPinnedToMenu ? 'Unpin from Menu' : 'Pin to Menu',
|
name: isPinnedToMenu ? 'Unpin from Menu' : 'Pin to Menu',
|
||||||
@@ -337,6 +341,7 @@ export const ActionSheetComponent = ({
|
|||||||
close: false,
|
close: false,
|
||||||
check: true,
|
check: true,
|
||||||
on: isPinnedToMenu,
|
on: isPinnedToMenu,
|
||||||
|
id:notesnook.ids.dialogs.actionsheet.pinMenu
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -377,6 +382,7 @@ export const ActionSheetComponent = ({
|
|||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
key={item.name}
|
key={item.name}
|
||||||
activeOpacity={opacity}
|
activeOpacity={opacity}
|
||||||
|
testID={item.id}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
item.func();
|
item.func();
|
||||||
}}
|
}}
|
||||||
@@ -610,6 +616,7 @@ export const ActionSheetComponent = ({
|
|||||||
<Paragraph
|
<Paragraph
|
||||||
color={colors.accent}
|
color={colors.accent}
|
||||||
size={SIZE.xs}
|
size={SIZE.xs}
|
||||||
|
testID={notesnook.ids.dialogs.actionsheet.sync}
|
||||||
onPress={onPressSync}
|
onPress={onPressSync}
|
||||||
style={{
|
style={{
|
||||||
textAlignVertical: 'center',
|
textAlignVertical: 'center',
|
||||||
@@ -656,6 +663,7 @@ export const ActionSheetComponent = ({
|
|||||||
accentColor="errorBg"
|
accentColor="errorBg"
|
||||||
type={note.locked ? 'accent' : 'shade'}
|
type={note.locked ? 'accent' : 'shade'}
|
||||||
onPress={onPressVaultButton}
|
onPress={onPressVaultButton}
|
||||||
|
testID={notesnook.ids.dialogs.actionsheet.vault}
|
||||||
customStyle={{
|
customStyle={{
|
||||||
width: '95%',
|
width: '95%',
|
||||||
alignSelf: 'center',
|
alignSelf: 'center',
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import {Platform, StyleSheet, TouchableOpacity, View} from 'react-native';
|
|||||||
import FileViewer from 'react-native-file-viewer';
|
import FileViewer from 'react-native-file-viewer';
|
||||||
import {exp} from 'react-native-reanimated';
|
import {exp} from 'react-native-reanimated';
|
||||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||||
|
import { notesnook } from '../../../e2e/test.ids';
|
||||||
import {useTracked} from '../../provider';
|
import {useTracked} from '../../provider';
|
||||||
import {DDS} from '../../services/DeviceDetection';
|
import {DDS} from '../../services/DeviceDetection';
|
||||||
import {eSendEvent, ToastEvent} from '../../services/EventManager';
|
import {eSendEvent, ToastEvent} from '../../services/EventManager';
|
||||||
@@ -106,6 +107,7 @@ const ExportDialog = () => {
|
|||||||
},
|
},
|
||||||
icon: 'file-pdf-box',
|
icon: 'file-pdf-box',
|
||||||
desc: 'Most commonly used, opens on any device.',
|
desc: 'Most commonly used, opens on any device.',
|
||||||
|
id:notesnook.ids.dialogs.export.pdf
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Markdown',
|
title: 'Markdown',
|
||||||
@@ -126,6 +128,7 @@ const ExportDialog = () => {
|
|||||||
},
|
},
|
||||||
icon: 'language-markdown',
|
icon: 'language-markdown',
|
||||||
desc: 'Most commonly used, opens on any device.',
|
desc: 'Most commonly used, opens on any device.',
|
||||||
|
id:notesnook.ids.dialogs.export.md
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Plain Text',
|
title: 'Plain Text',
|
||||||
@@ -134,6 +137,7 @@ const ExportDialog = () => {
|
|||||||
},
|
},
|
||||||
icon: 'card-text',
|
icon: 'card-text',
|
||||||
desc: 'A plain text file with no formatting.',
|
desc: 'A plain text file with no formatting.',
|
||||||
|
id:notesnook.ids.dialogs.export.text
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'HTML',
|
title: 'HTML',
|
||||||
@@ -154,6 +158,7 @@ const ExportDialog = () => {
|
|||||||
},
|
},
|
||||||
icon: 'language-html5',
|
icon: 'language-html5',
|
||||||
desc: 'A file that can be opened in a browser.',
|
desc: 'A file that can be opened in a browser.',
|
||||||
|
id:notesnook.ids.dialogs.export.html
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -186,6 +191,7 @@ const ExportDialog = () => {
|
|||||||
<Fragment key={item.title}>
|
<Fragment key={item.title}>
|
||||||
<Seperator half />
|
<Seperator half />
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
|
testID={item.id}
|
||||||
onPress={item.func}
|
onPress={item.func}
|
||||||
activeOpacity={1}
|
activeOpacity={1}
|
||||||
style={{
|
style={{
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {ActivityIndicator, StyleSheet, View} from 'react-native';
|
import {ActivityIndicator, StyleSheet, View} from 'react-native';
|
||||||
|
import { notesnook } from '../../../e2e/test.ids';
|
||||||
import {useTracked} from '../../provider';
|
import {useTracked} from '../../provider';
|
||||||
import {DDS} from '../../services/DeviceDetection';
|
import {DDS} from '../../services/DeviceDetection';
|
||||||
import Navigation from '../../services/Navigation';
|
import Navigation from '../../services/Navigation';
|
||||||
@@ -22,6 +23,7 @@ export const HeaderRightMenu = () => {
|
|||||||
menu: false,
|
menu: false,
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
|
testID={notesnook.ids.default.header.buttons.left}
|
||||||
name="magnify"
|
name="magnify"
|
||||||
size={SIZE.xxxl}
|
size={SIZE.xxxl}
|
||||||
color={colors.pri}
|
color={colors.pri}
|
||||||
@@ -33,6 +35,7 @@ export const HeaderRightMenu = () => {
|
|||||||
onPress={() => {
|
onPress={() => {
|
||||||
containerBottomButton.onPress();
|
containerBottomButton.onPress();
|
||||||
}}
|
}}
|
||||||
|
testID={notesnook.ids.default.addBtn}
|
||||||
icon={currentScreen === 'trash' ? 'delete' : 'plus'}
|
icon={currentScreen === 'trash' ? 'delete' : 'plus'}
|
||||||
iconSize={SIZE.xl}
|
iconSize={SIZE.xl}
|
||||||
type="shade"
|
type="shade"
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import React, { useEffect } from 'react';
|
import React, { useEffect } from 'react';
|
||||||
import {ActivityIndicator, Text} from 'react-native';
|
|
||||||
import Animated from 'react-native-reanimated';
|
import Animated from 'react-native-reanimated';
|
||||||
import { useTracked } from '../../provider';
|
import { useTracked } from '../../provider';
|
||||||
import { DDS } from '../../services/DeviceDetection';
|
import { DDS } from '../../services/DeviceDetection';
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import {
|
|||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import {useSafeAreaInsets} from 'react-native-safe-area-context';
|
import {useSafeAreaInsets} from 'react-native-safe-area-context';
|
||||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||||
|
import { notesnook } from '../../../e2e/test.ids';
|
||||||
import {useTracked} from '../../provider';
|
import {useTracked} from '../../provider';
|
||||||
import {Actions} from '../../provider/Actions';
|
import {Actions} from '../../provider/Actions';
|
||||||
import {DDS} from '../../services/DeviceDetection';
|
import {DDS} from '../../services/DeviceDetection';
|
||||||
@@ -172,6 +173,7 @@ const MoveNoteDialog = () => {
|
|||||||
onChangeText={(value) => {
|
onChangeText={(value) => {
|
||||||
newNotebookTitle = value;
|
newNotebookTitle = value;
|
||||||
}}
|
}}
|
||||||
|
testID={notesnook.ids.dialogs.addTo.addNotebook}
|
||||||
blurOnSubmit={false}
|
blurOnSubmit={false}
|
||||||
onFocus={() => {
|
onFocus={() => {
|
||||||
setNotebookInputFocused(true);
|
setNotebookInputFocused(true);
|
||||||
@@ -198,6 +200,7 @@ const MoveNoteDialog = () => {
|
|||||||
/>
|
/>
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
onPress={addNewNotebook}
|
onPress={addNewNotebook}
|
||||||
|
testID={notesnook.ids.dialogs.addTo.addNotebook}
|
||||||
style={[
|
style={[
|
||||||
{
|
{
|
||||||
borderRadius: 5,
|
borderRadius: 5,
|
||||||
@@ -285,6 +288,7 @@ const MoveNoteDialog = () => {
|
|||||||
onChangeText={(value) => {
|
onChangeText={(value) => {
|
||||||
newTopicTitle = value;
|
newTopicTitle = value;
|
||||||
}}
|
}}
|
||||||
|
testID={notesnook.ids.dialogs.addTo.addTopic}
|
||||||
blurOnSubmit={false}
|
blurOnSubmit={false}
|
||||||
onFocus={() => {
|
onFocus={() => {
|
||||||
setTopicInputFocused(true);
|
setTopicInputFocused(true);
|
||||||
@@ -311,6 +315,7 @@ const MoveNoteDialog = () => {
|
|||||||
/>
|
/>
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
onPress={addNewTopic}
|
onPress={addNewTopic}
|
||||||
|
testID={notesnook.ids.dialogs.addTo.btnTopic}
|
||||||
style={[
|
style={[
|
||||||
{
|
{
|
||||||
borderRadius: 5,
|
borderRadius: 5,
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import Navigation from '../../services/Navigation';
|
|||||||
import {COLORS_NOTE} from '../../utils/Colors';
|
import {COLORS_NOTE} from '../../utils/Colors';
|
||||||
import {db} from '../../utils/DB';
|
import {db} from '../../utils/DB';
|
||||||
import {SIZE} from '../../utils/SizeUtils';
|
import {SIZE} from '../../utils/SizeUtils';
|
||||||
import {timeSince} from '../../utils/TimeUtils';
|
|
||||||
import {ActionIcon} from '../ActionIcon';
|
import {ActionIcon} from '../ActionIcon';
|
||||||
import {ActionSheetEvent, updateEvent} from '../DialogManager/recievers';
|
import {ActionSheetEvent, updateEvent} from '../DialogManager/recievers';
|
||||||
import {TimeSince} from '../Menu/TimeSince';
|
import {TimeSince} from '../Menu/TimeSince';
|
||||||
@@ -56,6 +55,18 @@ export default class NoteItem extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
showActionSheet = () => {
|
||||||
|
ActionSheetEvent(
|
||||||
|
item,
|
||||||
|
isTrash ? false : true,
|
||||||
|
isTrash ? false : true,
|
||||||
|
isTrash
|
||||||
|
? ['Remove', 'Restore']
|
||||||
|
: ['Add to', 'Share', 'Export', 'Delete', 'Copy'],
|
||||||
|
isTrash ? [] : ['Pin', 'Favorite', 'Add to Vault'],
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
let {colors, item, customStyle, isTrash} = this.props;
|
let {colors, item, customStyle, isTrash} = this.props;
|
||||||
|
|
||||||
@@ -256,17 +267,7 @@ export default class NoteItem extends React.Component {
|
|||||||
name="dots-horizontal"
|
name="dots-horizontal"
|
||||||
testID={notesnook.ids.note.menu}
|
testID={notesnook.ids.note.menu}
|
||||||
size={SIZE.xl}
|
size={SIZE.xl}
|
||||||
onPress={() => {
|
onPress={this.showActionSheet}
|
||||||
ActionSheetEvent(
|
|
||||||
item,
|
|
||||||
isTrash ? false : true,
|
|
||||||
isTrash ? false : true,
|
|
||||||
isTrash
|
|
||||||
? ['Remove', 'Restore']
|
|
||||||
: ['Add to', 'Share', 'Export', 'Delete', 'Copy'],
|
|
||||||
isTrash ? [] : ['Pin', 'Favorite', 'Add to Vault'],
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
customStyle={{
|
customStyle={{
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
height: 35,
|
height: 35,
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {TouchableOpacity, View} from 'react-native';
|
import {TouchableOpacity, View} from 'react-native';
|
||||||
|
import {notesnook} from '../../../e2e/test.ids';
|
||||||
import {useTracked} from '../../provider';
|
import {useTracked} from '../../provider';
|
||||||
import Navigation from '../../services/Navigation';
|
import Navigation from '../../services/Navigation';
|
||||||
import {ph, pv, SIZE, WEIGHT} from '../../utils/SizeUtils';
|
import {ph, pv, SIZE, WEIGHT} from '../../utils/SizeUtils';
|
||||||
@@ -19,6 +20,21 @@ export const NotebookItem = ({
|
|||||||
const [state] = useTracked();
|
const [state] = useTracked();
|
||||||
const {colors} = state;
|
const {colors} = state;
|
||||||
|
|
||||||
|
const showActionSheet = () => {
|
||||||
|
let rowItems = isTrash
|
||||||
|
? ['Restore', 'Remove']
|
||||||
|
: [item.type == 'topic' ? 'Edit Topic' : 'Edit Notebook', 'Delete'];
|
||||||
|
|
||||||
|
let columnItems =
|
||||||
|
item.type === 'topic'
|
||||||
|
? ['Pin to Menu', 'Unpin from Menu']
|
||||||
|
: ['Pin', 'Pin to Menu', 'Unpin from Menu'];
|
||||||
|
|
||||||
|
ActionSheetEvent(item, false, false, rowItems, columnItems, {
|
||||||
|
notebookID: notebookID,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View
|
<View
|
||||||
style={[
|
style={[
|
||||||
@@ -179,24 +195,9 @@ export const NotebookItem = ({
|
|||||||
<ActionIcon
|
<ActionIcon
|
||||||
color={colors.heading}
|
color={colors.heading}
|
||||||
name="dots-horizontal"
|
name="dots-horizontal"
|
||||||
|
testID={notesnook.ids.notebook.menu}
|
||||||
size={SIZE.xl}
|
size={SIZE.xl}
|
||||||
onPress={() => {
|
onPress={showActionSheet}
|
||||||
let rowItems = isTrash
|
|
||||||
? ['Restore', 'Remove']
|
|
||||||
: [
|
|
||||||
item.type == 'topic' ? 'Edit Topic' : 'Edit Notebook',
|
|
||||||
'Delete',
|
|
||||||
];
|
|
||||||
|
|
||||||
let columnItems =
|
|
||||||
item.type === 'topic'
|
|
||||||
? ['Pin to Menu', 'Unpin from Menu']
|
|
||||||
: ['Pin', 'Pin to Menu', 'Unpin from Menu'];
|
|
||||||
|
|
||||||
ActionSheetEvent(item, false, false, rowItems, columnItems, {
|
|
||||||
notebookID: notebookID,
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
customStyle={{
|
customStyle={{
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
height: 35,
|
height: 35,
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ const SelectionWrapper = ({
|
|||||||
background,
|
background,
|
||||||
onLongPress,
|
onLongPress,
|
||||||
onPress,
|
onPress,
|
||||||
|
testID
|
||||||
}) => {
|
}) => {
|
||||||
const [state, dispatch] = useTracked();
|
const [state, dispatch] = useTracked();
|
||||||
const {colors, selectionMode, selectedItemsList, currentEditingNote} = state;
|
const {colors, selectionMode, selectedItemsList, currentEditingNote} = state;
|
||||||
@@ -74,6 +75,7 @@ const SelectionWrapper = ({
|
|||||||
? background
|
? background
|
||||||
: 'transparent'
|
: 'transparent'
|
||||||
}
|
}
|
||||||
|
testID={testID}
|
||||||
onLongPress={onLongPress}
|
onLongPress={onLongPress}
|
||||||
onPress={onPress}
|
onPress={onPress}
|
||||||
customSelectedColor={currentEditingNote ? colors.accent : colors.nav}
|
customSelectedColor={currentEditingNote ? colors.accent : colors.nav}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {Text, TouchableOpacity, View} from 'react-native';
|
import {Text, TouchableOpacity, View} from 'react-native';
|
||||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||||
|
import { notesnook } from '../../../e2e/test.ids';
|
||||||
import {useTracked} from '../../provider';
|
import {useTracked} from '../../provider';
|
||||||
import {DDS} from '../../services/DeviceDetection';
|
import {DDS} from '../../services/DeviceDetection';
|
||||||
import {COLORS_NOTE} from '../../utils/Colors';
|
import {COLORS_NOTE} from '../../utils/Colors';
|
||||||
@@ -17,6 +18,7 @@ export const MessageCard = ({data}) => {
|
|||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
activeOpacity={0.7}
|
activeOpacity={0.7}
|
||||||
onPress={messageBoardState.onPress}
|
onPress={messageBoardState.onPress}
|
||||||
|
testID={notesnook.ids.default.loginToSync}
|
||||||
style={{
|
style={{
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import {TEMPLATE_TRASH} from '../DialogManager/Templates';
|
|||||||
import {db} from '../../utils/DB';
|
import {db} from '../../utils/DB';
|
||||||
import {DDS} from '../../services/DeviceDetection';
|
import {DDS} from '../../services/DeviceDetection';
|
||||||
import {tabBarRef} from '../../utils/Refs';
|
import {tabBarRef} from '../../utils/Refs';
|
||||||
|
import { notesnook } from '../../../e2e/test.ids';
|
||||||
|
|
||||||
export const NoteItemWrapper = ({item, index, isTrash = false}) => {
|
export const NoteItemWrapper = ({item, index, isTrash = false}) => {
|
||||||
const [state, dispatch] = useTracked();
|
const [state, dispatch] = useTracked();
|
||||||
@@ -89,6 +90,7 @@ export const NoteItemWrapper = ({item, index, isTrash = false}) => {
|
|||||||
return (
|
return (
|
||||||
<SelectionWrapper
|
<SelectionWrapper
|
||||||
index={index}
|
index={index}
|
||||||
|
testID={notesnook.ids.note.get(index)}
|
||||||
onLongPress={onLongPress}
|
onLongPress={onLongPress}
|
||||||
onPress={onPress}
|
onPress={onPress}
|
||||||
item={note}>
|
item={note}>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import React, {useMemo} from 'react';
|
import React, {useMemo} from 'react';
|
||||||
|
import { notesnook } from '../../../e2e/test.ids';
|
||||||
import {NotebookItem} from '../../components/NotebookItem';
|
import {NotebookItem} from '../../components/NotebookItem';
|
||||||
import SelectionWrapper from '../../components/SelectionWrapper';
|
import SelectionWrapper from '../../components/SelectionWrapper';
|
||||||
import {useTracked} from '../../provider';
|
import {useTracked} from '../../provider';
|
||||||
@@ -58,6 +59,7 @@ export const NotebookItemWrapper = ({
|
|||||||
<SelectionWrapper
|
<SelectionWrapper
|
||||||
onLongPress={onLongPress}
|
onLongPress={onLongPress}
|
||||||
pinned={pinned}
|
pinned={pinned}
|
||||||
|
testID={isTopic? notesnook.ids.topic.get(index) : notesnook.ids.notebook.get(index)}
|
||||||
index={index}
|
index={index}
|
||||||
onPress={onPress}
|
onPress={onPress}
|
||||||
item={item}>
|
item={item}>
|
||||||
|
|||||||
@@ -3,14 +3,10 @@ import {
|
|||||||
ActivityIndicator,
|
ActivityIndicator,
|
||||||
Platform,
|
Platform,
|
||||||
RefreshControl,
|
RefreshControl,
|
||||||
StyleSheet,
|
|
||||||
useWindowDimensions,
|
useWindowDimensions,
|
||||||
View,
|
View,
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import {
|
import {useSafeAreaInsets} from 'react-native-safe-area-context';
|
||||||
initialWindowMetrics,
|
|
||||||
useSafeAreaInsets,
|
|
||||||
} from 'react-native-safe-area-context';
|
|
||||||
import {DataProvider, LayoutProvider, RecyclerListView} from 'recyclerlistview';
|
import {DataProvider, LayoutProvider, RecyclerListView} from 'recyclerlistview';
|
||||||
import {useTracked} from '../../provider';
|
import {useTracked} from '../../provider';
|
||||||
import {Actions} from '../../provider/Actions';
|
import {Actions} from '../../provider/Actions';
|
||||||
@@ -300,6 +296,7 @@ const SimpleList = ({
|
|||||||
alignSelf: 'center',
|
alignSelf: 'center',
|
||||||
minHeight: '100%',
|
minHeight: '100%',
|
||||||
},
|
},
|
||||||
|
testID: 'list-' + type,
|
||||||
}}
|
}}
|
||||||
style={{
|
style={{
|
||||||
height: '100%',
|
height: '100%',
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import React, {createRef} from 'react';
|
import React, {createRef} from 'react';
|
||||||
import {TouchableOpacity, View} from 'react-native';
|
import {TouchableOpacity, View} from 'react-native';
|
||||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||||
|
import { notesnook } from '../../../e2e/test.ids';
|
||||||
import {Actions} from '../../provider/Actions';
|
import {Actions} from '../../provider/Actions';
|
||||||
import {defaultState} from '../../provider/DefaultState';
|
import {defaultState} from '../../provider/DefaultState';
|
||||||
import {DDS} from '../../services/DeviceDetection';
|
import {DDS} from '../../services/DeviceDetection';
|
||||||
@@ -120,6 +121,7 @@ class SortDialog extends React.Component {
|
|||||||
</Heading>
|
</Heading>
|
||||||
|
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
|
testID={notesnook.ids.dialogs.sortBy.order}
|
||||||
onPress={async () => {
|
onPress={async () => {
|
||||||
let value =
|
let value =
|
||||||
this.state.settings.sortOrder === 'asc' ? 'des' : 'asc';
|
this.state.settings.sortOrder === 'asc' ? 'des' : 'asc';
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {View} from 'react-native';
|
import {View} from 'react-native';
|
||||||
|
import { notesnook } from '../../../e2e/test.ids';
|
||||||
import {PressableButton} from '../../components/PressableButton';
|
import {PressableButton} from '../../components/PressableButton';
|
||||||
import {useTracked} from '../../provider';
|
import {useTracked} from '../../provider';
|
||||||
import Navigation from '../../services/Navigation';
|
import Navigation from '../../services/Navigation';
|
||||||
@@ -33,6 +34,7 @@ const TagItem = ({item, index}) => {
|
|||||||
<PressableButton
|
<PressableButton
|
||||||
onPress={onPress}
|
onPress={onPress}
|
||||||
selectedColor={colors.nav}
|
selectedColor={colors.nav}
|
||||||
|
testID={notesnook.ids.tag.get(index)}
|
||||||
alpha={!colors.night ? -0.02 : 0.02}
|
alpha={!colors.night ? -0.02 : 0.02}
|
||||||
opacity={1}
|
opacity={1}
|
||||||
customStyle={{
|
customStyle={{
|
||||||
@@ -79,6 +81,7 @@ const TagItem = ({item, index}) => {
|
|||||||
let columnItems = ['Pin to Menu', 'Unpin from Menu'];
|
let columnItems = ['Pin to Menu', 'Unpin from Menu'];
|
||||||
ActionSheetEvent(item, false, false, rowItems, columnItems);
|
ActionSheetEvent(item, false, false, rowItems, columnItems);
|
||||||
}}
|
}}
|
||||||
|
testID={notesnook.ids.tag.menu}
|
||||||
customStyle={{
|
customStyle={{
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
height: 35,
|
height: 35,
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import {TextInput} from 'react-native-gesture-handler';
|
|||||||
import * as Keychain from 'react-native-keychain';
|
import * as Keychain from 'react-native-keychain';
|
||||||
import Share from 'react-native-share';
|
import Share from 'react-native-share';
|
||||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||||
|
import {notesnook} from '../../../e2e/test.ids';
|
||||||
import {Actions} from '../../provider/Actions';
|
import {Actions} from '../../provider/Actions';
|
||||||
import {DDS} from '../../services/DeviceDetection';
|
import {DDS} from '../../services/DeviceDetection';
|
||||||
import {
|
import {
|
||||||
@@ -313,13 +314,13 @@ export class VaultDialog extends Component {
|
|||||||
toTXT(data) {
|
toTXT(data) {
|
||||||
return data.reduce(function (text, op) {
|
return data.reduce(function (text, op) {
|
||||||
if (!op.insert) return text;
|
if (!op.insert) return text;
|
||||||
if (typeof op.insert !== "string") return text + " ";
|
if (typeof op.insert !== 'string') return text + ' ';
|
||||||
return text + op.insert;
|
return text + op.insert;
|
||||||
}, "");
|
}, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
_shareNote(note) {
|
_shareNote(note) {
|
||||||
let text = this.toTXT(note.content.data)
|
let text = this.toTXT(note.content.data);
|
||||||
let m = `${note.title}\n \n ${text}`;
|
let m = `${note.title}\n \n ${text}`;
|
||||||
Share.open({
|
Share.open({
|
||||||
title: 'Share note to',
|
title: 'Share note to',
|
||||||
@@ -439,12 +440,13 @@ export class VaultDialog extends Component {
|
|||||||
|
|
||||||
<Seperator />
|
<Seperator />
|
||||||
|
|
||||||
{changePassword ? (
|
{novault || changePassword ? (
|
||||||
<>
|
<>
|
||||||
<TextInput
|
<TextInput
|
||||||
ref={passInputRef}
|
ref={passInputRef}
|
||||||
editable={!loading}
|
editable={!loading}
|
||||||
autoCapitalize="none"
|
autoCapitalize="none"
|
||||||
|
testID={notesnook.ids.dialogs.vault.pwd}
|
||||||
style={{
|
style={{
|
||||||
padding: pv - 5,
|
padding: pv - 5,
|
||||||
borderBottomWidth: 1.5,
|
borderBottomWidth: 1.5,
|
||||||
@@ -494,6 +496,7 @@ export class VaultDialog extends Component {
|
|||||||
<TextInput
|
<TextInput
|
||||||
ref={changePassInputRef}
|
ref={changePassInputRef}
|
||||||
editable={!loading}
|
editable={!loading}
|
||||||
|
testID={notesnook.ids.dialogs.vault.changePwd}
|
||||||
autoCapitalize="none"
|
autoCapitalize="none"
|
||||||
style={{
|
style={{
|
||||||
padding: pv - 5,
|
padding: pv - 5,
|
||||||
@@ -529,6 +532,7 @@ export class VaultDialog extends Component {
|
|||||||
<TextInput
|
<TextInput
|
||||||
ref={passInputRef}
|
ref={passInputRef}
|
||||||
autoCapitalize="none"
|
autoCapitalize="none"
|
||||||
|
testID={notesnook.ids.dialogs.vault.pwd}
|
||||||
style={{
|
style={{
|
||||||
padding: pv - 5,
|
padding: pv - 5,
|
||||||
borderBottomWidth: 1.5,
|
borderBottomWidth: 1.5,
|
||||||
@@ -557,6 +561,7 @@ export class VaultDialog extends Component {
|
|||||||
<TextInput
|
<TextInput
|
||||||
ref={confirmPassRef}
|
ref={confirmPassRef}
|
||||||
autoCapitalize="none"
|
autoCapitalize="none"
|
||||||
|
testID={notesnook.ids.dialogs.vault.pwdAlt}
|
||||||
style={{
|
style={{
|
||||||
padding: pv - 5,
|
padding: pv - 5,
|
||||||
borderBottomWidth: 1.5,
|
borderBottomWidth: 1.5,
|
||||||
@@ -603,6 +608,7 @@ export class VaultDialog extends Component {
|
|||||||
biometricUnlock: !biometricUnlock,
|
biometricUnlock: !biometricUnlock,
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
|
testID={notesnook.ids.dialogs.vault.fingerprint}
|
||||||
activeOpacity={0.7}
|
activeOpacity={0.7}
|
||||||
style={{
|
style={{
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
@@ -628,9 +634,7 @@ export class VaultDialog extends Component {
|
|||||||
maxWidth: '90%',
|
maxWidth: '90%',
|
||||||
marginLeft: 10,
|
marginLeft: 10,
|
||||||
}}>
|
}}>
|
||||||
{!biometricUnlock
|
Fingerprint Unlock
|
||||||
? 'Fingerprint Unlock Disabled'
|
|
||||||
: 'Fingerprint Unlock Enabled'}
|
|
||||||
</Paragraph>
|
</Paragraph>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
) : null}
|
) : null}
|
||||||
|
|||||||
Reference in New Issue
Block a user