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

Added Settings Modal #342

Merged
merged 48 commits into from
Jun 2, 2023
Merged
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
af28fe8
Improve UI with style changes and add Settings button
techwithanirudh May 20, 2023
0706283
Revert not needed changes
techwithanirudh May 20, 2023
52a8a98
Updated style.css to only work for select
techwithanirudh May 20, 2023
eff8387
feat: Remove Dark Mode component and add theme selection feature
techwithanirudh May 20, 2023
2797887
Add auto theme setting to Settings component.
techwithanirudh May 20, 2023
e8d6ffb
Improve user experience by allowing customized themes
techwithanirudh May 20, 2023
489b48e
feat(Nav): Add SVG icon to settings gear
techwithanirudh May 20, 2023
eb1a85c
Merge branch 'main' into settings
techwithanirudh May 21, 2023
7ef00b4
Merge branch 'settings' of https://github.com/techwithanirudh/chatgpt…
techwithanirudh May 21, 2023
fd1f0d0
refactor(ui): Update overlay background color
techwithanirudh May 21, 2023
6b63fdf
Refactor ThemeContext to include system theme and fix bug in Settings
techwithanirudh May 21, 2023
8f83249
Refactor DialogTemplate styles and color scheme
techwithanirudh May 21, 2023
425f33d
Refactor: Change button logic to require confirmation before clearing…
techwithanirudh May 22, 2023
234fe41
Merge branch 'main' into settings
techwithanirudh May 22, 2023
0a6e314
Merge branch 'settings' of https://github.com/techwithanirudh/chatgpt…
techwithanirudh May 22, 2023
c72ff50
Refactor component name to reflect functionality change.
techwithanirudh May 22, 2023
8919a3a
Refactor conversation clearing functionality in `Settings.jsx`
techwithanirudh May 22, 2023
5575df1
Refactor Input component UI styles
techwithanirudh May 22, 2023
0156b9f
feat: Add e2e test for Settings modal
techwithanirudh May 22, 2023
753a02f
test: Add Navigation and Settings tests
techwithanirudh May 22, 2023
00d9d3c
Quick fix
techwithanirudh May 22, 2023
cbdeec4
feat(navbar): Add confirmation before clearing conversations
techwithanirudh May 22, 2023
f98a556
Add click functionality to the navigation bar and improve UI design
techwithanirudh May 22, 2023
f0890ad
test: Add test for dark mode theme change
techwithanirudh May 22, 2023
c1101bd
Improve navigation test clarity
techwithanirudh May 22, 2023
b786356
Improve navigation test clarity
techwithanirudh May 22, 2023
fb83608
Hotfix
techwithanirudh May 22, 2023
0073ac6
Removed repetation
techwithanirudh May 22, 2023
7413e2e
Merge branch 'main' into settings
techwithanirudh May 23, 2023
ad2dc3c
Refactor: Change text-gray-400 to text-white/50 to make tailwind more…
techwithanirudh May 23, 2023
8bef8f5
style: Update CSS classes to improve the conversation UI
techwithanirudh May 23, 2023
45f2884
Merge branch 'main' into settings
techwithanirudh May 23, 2023
2988fe7
Merge branch 'main' into settings
techwithanirudh May 24, 2023
acbaa6d
Refactor EndpointItem, EndpointItems, and NewConversationMenu for bet…
techwithanirudh May 24, 2023
853a1bf
Merge branch 'settings' of https://github.com/techwithanirudh/chatgpt…
techwithanirudh May 24, 2023
a48d556
Added error messages
techwithanirudh May 25, 2023
e47040b
refactor: Improve endpoint menu highlighting and error handling
techwithanirudh May 25, 2023
f70e4b7
test: Add Conversation and Change Path of Auth JSON
techwithanirudh May 26, 2023
dca7486
Merge branch 'main' into settings
techwithanirudh May 26, 2023
a2d5137
Merge branch 'main' into settings
techwithanirudh May 27, 2023
6e20a9e
Merge branch 'main' into settings
techwithanirudh May 27, 2023
0a14074
Fixed logo issues
techwithanirudh May 28, 2023
4a4c93a
Make everything not rounded
techwithanirudh May 28, 2023
b7f85b0
Merge branch 'danny-avila:main' into settings
techwithanirudh May 29, 2023
8ff999a
Merge branch 'main' into settings
techwithanirudh May 30, 2023
80c2567
Merge branch 'main' into settings
techwithanirudh May 31, 2023
c1ceef6
Added time
techwithanirudh Jun 1, 2023
d8b38a5
Merge branch 'main' into settings
danny-avila Jun 2, 2023
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
Prev Previous commit
Next Next commit
Improve navigation test clarity
This commit improves code clarity and adds more detailed test assertions to the navigation suite. New assert statements are added to check whether the modal theme selection changes the theme and that the HTML element receives the 'dark' class. A new function `changeMode` was introduced to avoid code repetition. A short description was added to the commit message to adhere to best practices.
  • Loading branch information
techwithanirudh committed May 22, 2023
commit c1101bd11d597521a327988ee0923fce49a3edcc
24 changes: 15 additions & 9 deletions e2e/specs/nav.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ test.describe('Navigation suite', () => {
test('Navigation bar', async () => {
const page = await myBrowser.newPage();
await page.goto('http://localhost:3080/');

await page.locator('[id="headlessui-menu-button-\\:r0\\:"]').click();
const navBar = await page.locator('[id="headlessui-menu-button-\\:r0\\:"]').isVisible();
expect(navBar).toBeTruthy();
Expand Down Expand Up @@ -40,14 +40,20 @@ test.describe('Navigation suite', () => {
const modalClearConvos = await page.getByRole('button', { name: 'Clear' }).isVisible();
expect(modalClearConvos).toBeTruthy();

const modalTheme = await page.getByRole('combobox');
expect(modalTheme.isVisible()).toBeTruthy();
// change the value to 'dark' and 'light' and see if the theme changes
await modalTheme.selectOption({ label: 'Dark' });
await page.waitForTimeout(1000);
async function changeMode(theme) {
const modalTheme = await page.getByRole('combobox');
expect(modalTheme.isVisible()).toBeTruthy();
// change the value to 'dark' and 'light' and see if the theme changes
await modalTheme.selectOption({ label: theme });
await page.waitForTimeout(1000);


// Check if the HTML element has the 'dark' class
const html = await page.$eval('html', (element) => element.classList.contains(theme.toLowerCase()));
expect(html).toBeTruthy();
}

// Check if the HTML element has the 'dark' class
const html = await page.$eval('html', (element) => element.classList.contains('dark'));
expect(html).toBeTruthy();
await changeMode('Dark');
await changeMode('Light');
});
});