-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #162 from Katyusha-Group/test/Modals
Test/modals
- Loading branch information
Showing
10 changed files
with
138 additions
and
27 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,13 +1,14 @@ | ||
|
||
import axios from "axios"; | ||
import { apis } from "../../assets/apis"; | ||
import { returnToken } from "../returnToken"; | ||
export function saveWallet(setWallet) { | ||
const token = JSON.parse(localStorage.getItem("authTokens")).token.access; | ||
axios(apis["accounts"]["wallet"]["seeWallet"], { | ||
headers: { Authorization: `Bearer ${token}` }, | ||
const token = returnToken(); | ||
axios(apis["accounts"]["wallet"]["seeWallet"], { | ||
headers: { Authorization: `Bearer ${token}` }, | ||
}) | ||
.then((data) => { | ||
setWallet(data.balance); | ||
}) | ||
.then((data) => { | ||
setWallet(data.balance); | ||
}) | ||
.catch((error) => console.error(error)); | ||
} | ||
.catch((error) => console.error(error)); | ||
} |
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,27 @@ | ||
// import { describe, it, expect, vi, test } from "vitest"; | ||
// import { Movies } from './Movies'; | ||
// Imports | ||
|
||
import { describe, it, expect, vi, test } from 'vitest'; | ||
import { render, screen } from '@testing-library/react'; | ||
import isValidPassword from './isValidPassword'; | ||
import * as Router from "react-router-dom"; | ||
import ContextInfo from '../contexts/InfoContext'; | ||
describe('Renders main page correctly', () => { | ||
it('should render the fucntion without crashing', () => { | ||
render(<ContextInfo><Router.BrowserRouter><isValidPassword /></Router.BrowserRouter></ContextInfo>); | ||
}); | ||
}); | ||
|
||
// test("UserPage component", () => { | ||
// it("should render the Instructorall component", () => { | ||
// const { getByTestId } = render(<UserPage />); | ||
// expect(getByTestId("instructor-all")).toBeInTheDocument(); | ||
// }); | ||
// }); | ||
test("isValidPassword function", () => { | ||
// it("should render the weekly schedule table", () => { | ||
// const { getByText } = render(<UserPage />); | ||
// expect(getByText("برنامه هفتگی")).toBeInTheDocument(); | ||
// }); | ||
}); |
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,27 @@ | ||
// import { describe, it, expect, vi, test } from "vitest"; | ||
// import { Movies } from './Movies'; | ||
// Imports | ||
|
||
import { describe, it, expect, vi, test } from 'vitest'; | ||
import { render, screen } from '@testing-library/react'; | ||
import Shopping from './Shopping'; | ||
import * as Router from "react-router-dom"; | ||
import ContextInfo from '../../contexts/InfoContext'; | ||
describe('Renders main page correctly', () => { | ||
it('should render the Shopping component without crashing', () => { | ||
render(<ContextInfo><Router.BrowserRouter><Shopping /></Router.BrowserRouter></ContextInfo>); | ||
}); | ||
}); | ||
|
||
// test("UserPage component", () => { | ||
// it("should render the Instructorall component", () => { | ||
// const { getByTestId } = render(<UserPage />); | ||
// expect(getByTestId("instructor-all")).toBeInTheDocument(); | ||
// }); | ||
// }); | ||
test("Shopping component", () => { | ||
// it("should render the weekly schedule table", () => { | ||
// const { getByText } = render(<UserPage />); | ||
// expect(getByText("برنامه هفتگی")).toBeInTheDocument(); | ||
// }); | ||
}); |
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,27 @@ | ||
// import { describe, it, expect, vi, test } from "vitest"; | ||
// import { Movies } from './Movies'; | ||
// Imports | ||
|
||
import { describe, it, expect, vi, test } from 'vitest'; | ||
import { render, screen } from '@testing-library/react'; | ||
import Chat from './Chat'; | ||
import * as Router from "react-router-dom"; | ||
import ContextInfo from '../../contexts/InfoContext'; | ||
describe('Renders Chat page correctly', () => { | ||
it('should render the Chat component without crashing', () => { | ||
render(<ContextInfo><Router.BrowserRouter><Chat /></Router.BrowserRouter></ContextInfo>); | ||
}); | ||
}); | ||
|
||
// test("UserPage component", () => { | ||
// it("should render the Instructorall component", () => { | ||
// const { getByTestId } = render(<UserPage />); | ||
// expect(getByTestId("instructor-all")).toBeInTheDocument(); | ||
// }); | ||
// }); | ||
test("Chat component", () => { | ||
// it("should render the weekly schedule table", () => { | ||
// const { getByText } = render(<UserPage />); | ||
// expect(getByText("برنامه هفتگی")).toBeInTheDocument(); | ||
// }); | ||
}); |
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,27 @@ | ||
// import { describe, it, expect, vi, test } from "vitest"; | ||
// import { Movies } from './Movies'; | ||
// Imports | ||
|
||
import { describe, it, expect, vi, test } from 'vitest'; | ||
import { render, screen } from '@testing-library/react'; | ||
import Timeline from './Timeline'; | ||
import * as Router from "react-router-dom"; | ||
import ContextInfo from '../../contexts/InfoContext'; | ||
describe('Renders Timeline page correctly', () => { | ||
it('should render the Timeline component without crashing', () => { | ||
render(<ContextInfo><Router.BrowserRouter><Timeline /></Router.BrowserRouter></ContextInfo>); | ||
}); | ||
}); | ||
|
||
// test("UserPage component", () => { | ||
// it("should render the Instructorall component", () => { | ||
// const { getByTestId } = render(<UserPage />); | ||
// expect(getByTestId("instructor-all")).toBeInTheDocument(); | ||
// }); | ||
// }); | ||
test("Timeline component", () => { | ||
// it("should render the weekly schedule table", () => { | ||
// const { getByText } = render(<UserPage />); | ||
// expect(getByText("برنامه هفتگی")).toBeInTheDocument(); | ||
// }); | ||
}); |