Skip to content

Commit

Permalink
check deleted user in archived and restore
Browse files Browse the repository at this point in the history
  • Loading branch information
Bobbykumar706584 committed Oct 4, 2023
1 parent c21b27a commit 2724d9f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
22 changes: 22 additions & 0 deletions e2e-tests/base.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,28 @@ test("Click the view users button, log in with playwright user, and sign out", a
}
})

test("Delete the user from the active tab and check in the archived tab", async ({ userName }) => {
await showActiveUsers(window, expect)
const tabContent = await window.locator('//*[@id="active-tab-content"]')
const items = await tabContent.locator('div > div')
const div = await tabContent.locator("div > button")
for (let i = 0; i < await items.count(); i++) {
if (await items.nth(i).textContent() === userName.toLowerCase()) {
await div.nth(i).click()
expect(await window.locator('//*[@id="archived-tab"]')).toBeVisible()
await window.locator('//*[@id="archived-tab"]').click()
const text = await window.locator('//*[@id="archived-tab"]').textContent()
expect(await text).toBe('Archived')
await window.getByLabel('Archived').locator('button').click()
expect(await window.locator('//*[@id="active-tab"]')).toBeVisible()
await window.locator('//*[@id="active-tab"]').click()
await window.getByRole('button', { name: userName.toLowerCase() }).click()
}
}
const title = await window.textContent('[aria-label=projects]')
await expect(title).toBe('Projects')
})

test("Logout and delete that playwright user from the backend", async ({ userName }) => {
// user json
const json = await userJson(window, packageInfo, fs, path)
Expand Down
5 changes: 4 additions & 1 deletion renderer/src/components/Login/LeftLogin.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ const LeftLogin = () => {
<button
type="button"
onClick={openModal}
id="view-more"
className={`
${isOpen ? '' : 'text-opacity-90'
} text-white bg-black w-48 text-xs lg:w-72 sm:w-52 py-[12px] flex items-center justify-center text-md font-bold rounded-b-[10px] sm:text-sm`}
Expand Down Expand Up @@ -247,6 +248,7 @@ const LeftLogin = () => {
<Tab.Group onChange={() => setShowArchived((value) => !value)}>
<Tab.List className="flex space-x-0 rounded-xl">
<Tab
id="active-tab"
className={({ selected }) => classNames(
'w-full text-md items-center justify-center outline-none font-bold py-4 leading-5 rounded-t-lg',
'',
Expand All @@ -258,6 +260,7 @@ const LeftLogin = () => {
Active
</Tab>
<Tab
id="archived-tab"
className={({ selected }) => classNames(
'w-full text-md items-center justify-center outline-none font-bold py-4 leading-5 rounded-t-lg',
selected
Expand All @@ -271,7 +274,7 @@ const LeftLogin = () => {
</Tab.List>
<Tab.Panels>
<Tab.Panel className="relative overflow-y-auto h-[60vh] p-5">
<div className="grid grid-cols-2">
<div className="grid grid-cols-2" id="active-tab-content">
{sortedUsers.filter(filterUsers).map((user) => (
<div className="flex items-center" key={user.username}>
<div
Expand Down

0 comments on commit 2724d9f

Please sign in to comment.