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

fix: test require auth, admin service is protected #187

Merged
merged 1 commit into from
Dec 5, 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
3 changes: 3 additions & 0 deletions test/tests/graphiql.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
const { axios, GET } = cds.test(path.join(__dirname, '../resources/bookshop-graphql'))
// Prevent axios from throwing errors for non 2xx status codes
axios.defaults.validateStatus = false
axios.defaults.headers = {
authorization: 'Basic YWxpY2U6'
Dismissed Show dismissed Hide dismissed
}

test('GET request to endpoint should serve HTML containing GraphiQL', async () => {
const response = await GET('/graphql')
Expand Down
3 changes: 3 additions & 0 deletions test/tests/localized.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
const { axios, POST, data } = cds.test(path.join(__dirname, '../resources/bookshop-graphql'))
// Prevent axios from throwing errors for non 2xx status codes
axios.defaults.validateStatus = false
axios.defaults.headers = {
authorization: 'Basic YWxpY2U6'
Dismissed Show dismissed Hide dismissed
}

beforeEach(async () => {
await data.reset()
Expand Down
3 changes: 3 additions & 0 deletions test/tests/mutations/create.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
const { axios, POST, data } = cds.test(path.join(__dirname, '../../resources/bookshop-graphql'))
// Prevent axios from throwing errors for non 2xx status codes
axios.defaults.validateStatus = false
axios.defaults.headers = {
authorization: 'Basic YWxpY2U6'
Dismissed Show dismissed Hide dismissed
}

beforeEach(async () => {
await data.reset()
Expand Down
3 changes: 3 additions & 0 deletions test/tests/mutations/delete.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
const { axios, POST, data } = cds.test(path.join(__dirname, '../../resources/bookshop-graphql'))
// Prevent axios from throwing errors for non 2xx status codes
axios.defaults.validateStatus = false
axios.defaults.headers = {
authorization: 'Basic YWxpY2U6'
Dismissed Show dismissed Hide dismissed
}

beforeEach(async () => {
await data.reset()
Expand Down
3 changes: 3 additions & 0 deletions test/tests/mutations/update.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
const { axios, POST, data } = cds.test(path.join(__dirname, '../../resources/bookshop-graphql'))
// Prevent axios from throwing errors for non 2xx status codes
axios.defaults.validateStatus = false
axios.defaults.headers = {
authorization: 'Basic YWxpY2U6'
Dismissed Show dismissed Hide dismissed
}

beforeEach(async () => {
await data.reset()
Expand Down
3 changes: 3 additions & 0 deletions test/tests/queries/aliases.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
const { axios, POST } = cds.test(path.join(__dirname, '../../resources/bookshop-graphql'))
// Prevent axios from throwing errors for non 2xx status codes
axios.defaults.validateStatus = false
axios.defaults.headers = {
authorization: 'Basic YWxpY2U6'
Dismissed Show dismissed Hide dismissed
}

// REVISIT: unskip for support of configurable schema flavors
describe.skip('queries with aliases without connections', () => {
Expand Down
3 changes: 3 additions & 0 deletions test/tests/queries/filter.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
const { axios, POST, data } = cds.test(path.join(__dirname, '../../resources/bookshop-graphql'))
// Prevent axios from throwing errors for non 2xx status codes
axios.defaults.validateStatus = false
axios.defaults.headers = {
authorization: 'Basic YWxpY2U6'
Dismissed Show dismissed Hide dismissed
}

beforeEach(async () => {
await data.reset()
Expand Down
3 changes: 3 additions & 0 deletions test/tests/queries/fragments.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
const { axios, POST } = cds.test(path.join(__dirname, '../../resources/bookshop-graphql'))
// Prevent axios from throwing errors for non 2xx status codes
axios.defaults.validateStatus = false
axios.defaults.headers = {
authorization: 'Basic YWxpY2U6'
Dismissed Show dismissed Hide dismissed
}

// REVISIT: unskip for support of configurable schema flavors
describe.skip('queries with fragments without connections', () => {
Expand Down
3 changes: 3 additions & 0 deletions test/tests/queries/meta.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
const { axios, POST } = cds.test(path.join(__dirname, '../../resources/bookshop-graphql'))
// Prevent axios from throwing errors for non 2xx status codes
axios.defaults.validateStatus = false
axios.defaults.headers = {
authorization: 'Basic YWxpY2U6'
Dismissed Show dismissed Hide dismissed
}

// REVISIT: unskip for support of configurable schema flavors
describe.skip('queries with __typename meta field without connections', () => {
Expand Down
3 changes: 3 additions & 0 deletions test/tests/queries/orderBy.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
const { axios, POST } = cds.test(path.join(__dirname, '../../resources/bookshop-graphql'))
// Prevent axios from throwing errors for non 2xx status codes
axios.defaults.validateStatus = false
axios.defaults.headers = {
authorization: 'Basic YWxpY2U6'
Dismissed Show dismissed Hide dismissed
}

// REVISIT: unskip for support of configurable schema flavors
describe.skip('queries with orderBy argument without connections', () => {
Expand Down
3 changes: 3 additions & 0 deletions test/tests/queries/paging-offset.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
const { axios, POST } = cds.test(path.join(__dirname, '../../resources/bookshop-graphql'))
// Prevent axios from throwing errors for non 2xx status codes
axios.defaults.validateStatus = false
axios.defaults.headers = {
authorization: 'Basic YWxpY2U6'
Dismissed Show dismissed Hide dismissed
}

// REVISIT: unskip for support of configurable schema flavors
describe.skip('queries with paging arguments without connections', () => {
Expand Down
3 changes: 3 additions & 0 deletions test/tests/queries/queries.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
const { axios, POST, data } = cds.test(path.join(__dirname, '../../resources/bookshop-graphql'))
// Prevent axios from throwing errors for non 2xx status codes
axios.defaults.validateStatus = false
axios.defaults.headers = {
authorization: 'Basic YWxpY2U6'
Dismissed Show dismissed Hide dismissed
}

beforeEach(async () => {
await data.reset()
Expand Down
3 changes: 3 additions & 0 deletions test/tests/queries/totalCount.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
const { axios, POST } = cds.test(path.join(__dirname, '../../resources/bookshop-graphql'))
// Prevent axios from throwing errors for non 2xx status codes
axios.defaults.validateStatus = false
axios.defaults.headers = {
authorization: 'Basic YWxpY2U6'
Dismissed Show dismissed Hide dismissed
}

test('simple query with totalCount', async () => {
const query = gql`
Expand Down
3 changes: 3 additions & 0 deletions test/tests/queries/variables.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
const { axios, POST } = cds.test(path.join(__dirname, '../../resources/bookshop-graphql'))
// Prevent axios from throwing errors for non 2xx status codes
axios.defaults.validateStatus = false
axios.defaults.headers = {
authorization: 'Basic YWxpY2U6'
Dismissed Show dismissed Hide dismissed
}

// REVISIT: unskip for support of configurable schema flavors
describe.skip('queries with variables without connections', () => {
Expand Down
Loading