Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #143

Merged
merged 4 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ai-trip-creator/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ const App = () => {
</div>
}
/>
<Route path="/dashboard" element={<Dashboard />} />
<Route path="/profile" element={<Profile />} />
<Route path="/settings" element={<Settings />} />
<Route path="/flights" element={<Flights />} />
Expand Down
26 changes: 26 additions & 0 deletions ai-trip-creator/src/components/dashboard/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,32 @@ const Dashboard = () => {
<h1 style={{ marginLeft: "28px", marginTop: "30px" }}>
AI Trip Planning
</h1>
{showCards && (
<Box sx={{ display: "flex", gap: 2, padding: 2 }}>
<Card sx={{ width: "48%" }}>
<CardContent>
<Typography variant="h6">
Step 1: Start by Telling Us About Your Trip
</Typography>
<Typography>
Provide details like your destination, travel dates, and
preferences to create a personalized itinerary.
</Typography>
</CardContent>
</Card>
<Card sx={{ width: "48%" }}>
<CardContent>
<Typography variant="h6">
Step 2: Customize Your Itinerary
</Typography>
<Typography>
Once your itinerary is generated, it will automatically be
saved to the database.
</Typography>
</CardContent>
</Card>
</Box>
)}

<Box sx={{ flex: 1, overflowY: "auto", padding: 2 }}>
{responses.map((response, index) => (
Expand Down
20 changes: 20 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// const { defineConfig } = require("cypress");

// module.exports = defineConfig({
// e2e: {
// setupNodeEvents(on, config) {
// // implement node event listeners here
// },
// },
// });

const { defineConfig } = require("cypress");

module.exports = defineConfig({
e2e: {
baseUrl: "http://localhost:3000", // Adjust based on your app's port
setupNodeEvents(on, config) {
// implement node event listeners here
},
},
});
67 changes: 67 additions & 0 deletions cypress/e2e/dashboard.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// // describe('template spec', () => {
// // it('passes', () => {
// // cy.visit('https://example.cypress.io')
// // })
// // })
// // cypress/e2e/dashboard.cy.js
// describe('Dashboard Component', () => {
// beforeEach(() => {
// // Visit the Dashboard page
// cy.visit('/dashboard'); // Adjust if Dashboard is not on the home route
// });

// it('renders AI Trip Planning title', () => {
// cy.contains('AI Trip Planning').should('be.visible');
// });

// it('renders input field and submit button', () => {
// cy.get('input[placeholder="Ask me about your trip"]').should('be.visible');
// cy.get('button').should('be.visible');
// });

// it('accepts user input and displays it', () => {
// const inputText = 'Test trip to Durban';
// cy.get('input[placeholder="Ask me about your trip"]').type(inputText);
// cy.get('input[placeholder="Ask me about your trip"]').should('have.value', inputText);
// });

// it('disables button when input is empty', () => {
// cy.get('input[placeholder="Ask me about your trip"]').clear();
// cy.get('button').should('be.disabled');
// });

// it('enables button when input is filled', () => {
// cy.get('input[placeholder="Ask me about your trip"]').type('New trip');
// cy.get('button').should('not.be.disabled');
// });

// it('submits form and checks response', () => {
// // Simulate filling in the input and submitting
// cy.get('input[placeholder="Ask me about your trip"]').type('Test trip');
// cy.get('button').click();

// // Add additional assertions based on your form submission behavior
// cy.contains('Thank you for your submission').should('be.visible'); // Example, adjust as per your app's logic
// });
// });

// cypress/e2e/dashboard.cy.js
describe('Dashboard Component', () => {
beforeEach(() => {
// Visit the correct route for the Dashboard
cy.visit('/dashboard'); // Adjust the route if necessary
});

it('renders AI Trip Planning title', () => {
cy.contains('AI Trip Planning').should('be.visible');
});

it('renders input field and submit button', () => {
// Ensure the input field and submit button are present
cy.get('input[placeholder="Ask me about your trip..."]').should('be.visible');
cy.get('button').should('be.visible');
});



});
5 changes: 5 additions & 0 deletions cypress/fixtures/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "Using fixtures to represent data",
"email": "[email protected]",
"body": "Fixtures are a great way to mock data for responses to routes"
}
25 changes: 25 additions & 0 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add('login', (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
20 changes: 20 additions & 0 deletions cypress/support/e2e.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// ***********************************************************
// This example support/e2e.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands'

// Alternatively you can use CommonJS syntax:
// require('./commands')
Loading
Loading