e2e: add test ids

This commit is contained in:
ammarahm-ed
2022-04-01 00:57:55 +05:00
parent 74f70949ba
commit 57f3762c1e
7 changed files with 11 additions and 2 deletions

View File

@@ -129,11 +129,13 @@ export class AddTopicDialog extends React.Component {
<Seperator half />
<View
style={{
paddingHorizontal: 12
paddingHorizontal: 12,
zIndex: 10
}}
>
<Input
fwdRef={this.titleRef}
testID="input-title"
onChangeText={value => {
this.title = value;
}}

View File

@@ -334,6 +334,7 @@ export class VaultDialog extends Component {
});
try {
let verified = await db.user.verifyPassword(this.password);
if (!(await db.user.getUser())) verified = true;
if (verified) {
await db.vault.delete(this.state.deleteAll);
eSendEvent('vaultUpdated');
@@ -541,7 +542,7 @@ export class VaultDialog extends Component {
_openInEditor(note) {
this.close();
InteractionManager.runAfterInteractions(() => {
InteractionManager.runAfterInteractions(async () => {
eSendEvent(eOnLoadNote, note);
if (!DDS.isTab) {
tabBarRef.current?.goToPage(1);

View File

@@ -364,6 +364,7 @@ export class AddNotebookSheet extends React.Component {
}}
blurOnSubmit={false}
button={{
testID: 'topic-add-button',
icon: this.state.editTopic ? 'check' : 'plus',
onPress: this.onSubmit,
color: topicInputFocused ? colors.accent : colors.icon

View File

@@ -95,6 +95,7 @@ export const MoveNotes = ({
const renderItem = ({ item, index }) => {
return (
<PressableButton
testID="listitem.select"
onPress={() => {
if (item.type == 'topic') {
setTopic(topic ? null : item);

View File

@@ -37,6 +37,7 @@ interface InputProps extends TextInputProps {
icon: string;
color: ColorValue;
onPress: () => void;
testID?: string;
};
buttons?: React.ReactNode;
onBlurInput?: () => void;
@@ -257,6 +258,7 @@ const Input = ({
{button && (
<IconButton
testID={button.testID}
name={button.icon}
size={SIZE.xl}
top={10}

View File

@@ -60,6 +60,7 @@ const SheetWrapper = ({
return (
<ActionSheet
ref={fwdRef}
sheetBackdropId={'sheet-backdrop'}
drawUnderStatusBar={false}
containerStyle={style}
gestureEnabled={gestureEnabled}

View File

@@ -44,6 +44,7 @@ export const EditorWrapper = ({ width }) => {
return (
<View
testID="editor-wrapper"
ref={editorRef}
style={{
width: width[deviceMode].c,