-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
408 additions
and
11 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
let dashboardSpecMnemonic = ''; | ||
|
||
describe('Create account for DashboardView tests', () => { | ||
it('Connect', () => { | ||
cy.visit('/signup'); | ||
cy.wait(1000); | ||
cy.get('#ipc-signupView-credentials-signup-button').click(); | ||
cy.get('#ipc-signupView-text-area') | ||
.invoke('val') | ||
.then((input) => { | ||
dashboardSpecMnemonic = input; | ||
}); | ||
cy.get('#ipc-modal-close-button').click(); | ||
}); | ||
}); | ||
|
||
describe('Upload a program modal for DashboardView', () => { | ||
const fixtureFile = 'upload_test_program.zip'; | ||
|
||
beforeEach(() => { | ||
cy.visit('/login'); | ||
cy.wait(1000); | ||
cy.get('#ipc-loginView-text-area').click().type(dashboardSpecMnemonic); | ||
cy.get('#ipc-loginView-credentials-button').click().wait(3000); | ||
cy.get('#ipc-dashboardView-drawer-button').click({ force: true }); | ||
cy.get('#ipc-deploy-button').click().wait(2500); | ||
}); | ||
|
||
it('Good number of buttons after upload', () => { | ||
cy.get('#ipc-dashboardView-upload-program').attachFile(fixtureFile); | ||
cy.get('#ipc-dashboardView-upload-program-modal-button').click(); | ||
cy.wait(2000); | ||
cy.get('button').should('have.length', 10); | ||
}); | ||
|
||
it('Good number of buttons after closing modal', () => { | ||
cy.get('#ipc-modal-close-button').click(); | ||
cy.get('button').should('have.length', 10); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { Box, Flex, Text, VStack } from '@chakra-ui/react'; | ||
|
||
import { IPCProgram } from 'types/types'; | ||
|
||
type ProgramCardProps = { | ||
program: IPCProgram; | ||
children: JSX.Element; | ||
}; | ||
|
||
const ProgramCard = ({ program, children }: ProgramCardProps): JSX.Element => ( | ||
<Box | ||
p="16px" | ||
bg="white" | ||
w="100%" | ||
boxShadow="0px 2px 3px 3px rgb(240, 240, 240)" | ||
borderRadius="4px" | ||
border="1px solid rgb(200, 200, 200)" | ||
mb="8px" | ||
display="flex" | ||
justifyContent="space-between" | ||
> | ||
<VStack w="100%" justify="space-between" align="center"> | ||
<Text fontWeight="500" isTruncated maxW="100%"> | ||
{program.name} | ||
</Text> | ||
<Flex w="100%" justify="space-between" align="center"> | ||
{children} | ||
</Flex> | ||
</VStack> | ||
</Box> | ||
); | ||
|
||
export default ProgramCard; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { Button } from '@chakra-ui/react'; | ||
import ProgramCard from './ProgramCard'; | ||
import { IPCProgram } from '../types/types'; | ||
|
||
type ProgramCardsProps = { | ||
programs: IPCProgram[]; | ||
}; | ||
|
||
export const ProgramCards = ({ programs }: ProgramCardsProps): JSX.Element => ( | ||
<> | ||
{programs.map((program: IPCProgram) => ( | ||
<ProgramCard key={program.created_at} program={program}> | ||
<> | ||
<Button | ||
as="a" | ||
href={`https://aleph.sh/vm/${program.hash}`} | ||
target="_blank" | ||
variant="inline" | ||
size="sm" | ||
w="100%" | ||
p="0px" | ||
id="ipc-computingView-forwardUrl-button" | ||
> | ||
Go to site | ||
</Button> | ||
</> | ||
</ProgramCard> | ||
))} | ||
</> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.