Skip to content

Commit

Permalink
Fix tests caused due to name aliasing
Browse files Browse the repository at this point in the history
  • Loading branch information
1-Harshit committed Nov 17, 2023
1 parent 5338a7b commit e4a2240
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
9 changes: 7 additions & 2 deletions src/components/editor/EditorAreaMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export default function Banner(props: { [x: string]: any }) {
};

return (
<Menu isOpen={isOpen1} onClose={onClose1}>
<Menu isOpen={isOpen1} onClose={onClose1} id="editor-area-menu">
<MenuButton
alignItems='center'
justifyContent='center'
Expand Down Expand Up @@ -167,6 +167,7 @@ export default function Banner(props: { [x: string]: any }) {
}}
mb='10px'
onClick={handleSave}
id="save-button"
>
<Flex align='center'>
<Icon as={AiOutlineSave} h='16px' w='16px' me='8px' />
Expand All @@ -189,6 +190,7 @@ export default function Banner(props: { [x: string]: any }) {
}}
mb='10px'
onClick={handleOpen}
id="open-button"
>
<input type="file" accept=".txt, .html" id="fileInput" style={{ display: "none" }} onChange={handleFileInputChange}/>
<Flex align='center'>
Expand All @@ -212,6 +214,7 @@ export default function Banner(props: { [x: string]: any }) {
}}
mb='10px'
onClick={handleHTMLSave}
id="export-button"
>
<Flex align='center'>
<Icon as={AiOutlineExport} h='16px' w='16px' me='8px' />
Expand All @@ -232,7 +235,9 @@ export default function Banner(props: { [x: string]: any }) {
_focus={{
bg: 'transparent'
}}
onClick={handleClear}>
onClick={handleClear}
id="clear-button"
>
<Flex align='center'>
<Icon as={AiOutlineClear} h='16px' w='16px' me='8px' />
<Text fontSize='sm' fontWeight='400'>
Expand Down
4 changes: 2 additions & 2 deletions src/tests/EditorHome-alignment.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ beforeEach(() => {
cy.get("#word-count").should("have.text", wordCount);

// clear editor
cy.get("#menu-button-24").click();
cy.get("#menu-list-24-menuitem-22 > .css-70qvj9 > .chakra-text").click();
cy.get("#menu-button-editor-area-menu").click();
cy.get("#menu-list-editor-area-menu-menuitem-42 > .css-70qvj9 > .chakra-text").click();

// editor should be empty
cy.get("#editor-main").should("have.text", "");
Expand Down
4 changes: 2 additions & 2 deletions src/tests/EditorHome-formatting.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ beforeEach(() => {
cy.get("#word-count").should("have.text", wordCount);

// clear editor
cy.get("#menu-button-24").click();
cy.get("#menu-list-24-menuitem-22 > .css-70qvj9 > .chakra-text").click();
cy.get("#menu-button-editor-area-menu").click();
cy.get("#menu-list-editor-area-menu-menuitem-42 > .css-70qvj9 > .chakra-text").click();

// editor should be empty
cy.get("#editor-main").should("have.text", "");
Expand Down
6 changes: 3 additions & 3 deletions src/tests/EditorHome-lists.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ beforeEach(() => {
cy.get("#word-count").should("have.text", wordCount);

// clear editor
// click on cy.get('#menu-button-24')
cy.get("#menu-button-24").click();
cy.get("#menu-list-24-menuitem-22 > .css-70qvj9 > .chakra-text").click();
// click on cy.get('#menu-button-editor-area-menu')
cy.get("#menu-button-editor-area-menu").click();
cy.get("#menu-list-editor-area-menu-menuitem-42 > .css-70qvj9 > .chakra-text").click();

cy.get("#word-count").should("have.text", 0);

Expand Down
4 changes: 2 additions & 2 deletions src/tests/EditorHome.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ describe("<EditorHome />", () => {
cy.get("#word-count").should("have.text", wordCount);

// clear editor
cy.get("#menu-button-24").click();
cy.get("#menu-list-24-menuitem-22 > .css-70qvj9 > .chakra-text").click();
cy.get("#menu-button-editor-area-menu").click();
cy.get("#menu-list-editor-area-menu-menuitem-42 > .css-70qvj9 > .chakra-text").click();

// word count should be 0
cy.get("#word-count").should("have.text", 0);
Expand Down

0 comments on commit e4a2240

Please sign in to comment.