Skip to content

Commit

Permalink
refactor: remove redundant check (#24)
Browse files Browse the repository at this point in the history
* refactor: remove redundant check

* refactor: update test titles
  • Loading branch information
Kikobeats authored Jun 8, 2024
1 parent 96a26b1 commit 7738a65
Show file tree
Hide file tree
Showing 4 changed files with 169 additions and 262 deletions.
9 changes: 8 additions & 1 deletion src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,15 @@ const PAINT_CODES = [
'PR01'
]

const M3_GENERIC_CODES = ['MT3', 'W3', 'W4']
const M3_GENERIC_CODES = [
'MT3', // chasis
'W3', // wheels
'W4' // wheels
]

/**
* Models before heat pump refresh around October 2020
*/
const M3_NON_REFRESH = ['MT30', 'MT31', 'MT336']

const M3_INTERIOR_CODES = [
Expand Down
75 changes: 62 additions & 13 deletions test/model-3.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,29 @@ const teslaImages = require('..')

const { isAllReachable } = require('./util')

test('Model 3 2017', async t => {
test('Model 3 2017 MT301', async t => {
const photos = teslaImages({
modelLetter: 3,
optionCodes: [
'APBS',
'DV2W',
'IN3PB',
'PPMR',
'PRM31',
'SC04',
'MDL3',
'W39B',
'MT301',
'CPF0',
'RSF1'
]
})

t.true(await isAllReachable(photos))
t.snapshot(photos)
})

test('Model 3 2017 MT302', async t => {
const photos = teslaImages({
modelLetter: 3,
optionCodes: [
Expand All @@ -28,7 +50,7 @@ test('Model 3 2017', async t => {
t.snapshot(photos)
})

test('Model 3 2018', async t => {
test('Model 3 2018 MT303', async t => {
const photos = teslaImages({
modelLetter: 3,
optionCodes: [
Expand Down Expand Up @@ -62,10 +84,12 @@ test('Model 3 2019', async t => {
'APH3',
'AU3P',
'BC3B',
'BG30',
'BT37',
'CDM0',
'CH06',
'COAT',
'CPF0',
'DRLH',
'DV2W',
'FC3P',
Expand All @@ -74,19 +98,26 @@ test('Model 3 2019', async t => {
'GLFR',
'HL31',
'HM31',
'I38M',
'ID3W',
'IL31',
'LTPB',
'MDL3',
'MI00',
'MR31',
'OSSB',
'PBSB',
'PC30',
'PL30',
'REEU',
'RF3G',
'RS3H',
'RSF1',
'S3PB',
'SA3P',
'SC04',
'SLR0',
'ST31',
'STCP',
'SU3C',
'T3MS',
Expand All @@ -95,16 +126,7 @@ test('Model 3 2019', async t => {
'UT3P',
'W38B',
'WR00',
'ZINV',
'MI00',
'PL30',
'SLR0',
'ST31',
'BG30',
'I38M',
'OSSB',
'RSF1',
'CPF0'
'ZINV'
]
})
t.true(await isAllReachable(photos))
Expand Down Expand Up @@ -244,6 +266,33 @@ test('Model 3 2019 MT302', async t => {
t.true(await isAllReachable(photos))
t.snapshot(photos)
})
test('Model 3 2019 MT304', async t => {
const photos = teslaImages({
modelLetter: 3,
optionCodes: [
'APPB',
'APBS',
'BC3R',
'DV4W',
'IN3PB',
'PBSB',
'PRM31',
'SC04',
'MDL3',
'W32P',
'SLR1',
'MT304',
'PL31',
'SPT31',
'CPF0',
'DRRH',
'RSF1'
]
})

t.true(await isAllReachable(photos))
t.snapshot(photos)
})

test('Model 3 2020 MT336', async t => {
const photos = teslaImages({
Expand Down Expand Up @@ -472,7 +521,7 @@ test('Model 3 2021 MT323', async t => {
t.snapshot(photos)
})

test('Model 3 2021', async t => {
test('Model 3 2021 MT320', async t => {
const photos = teslaImages({
modelLetter: 3,
optionCodes: [
Expand Down
Loading

0 comments on commit 7738a65

Please sign in to comment.